- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- find . -inum 3232 -exec rm -i {} \;
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-20-2006 09:16 PM
тАО03-20-2006 09:16 PM
I am expecting it to ask me whethere or not to delete the file. But, this is what I am getting.
# ls -i
3232 -l
# find . -inum 3232 -exec rm -i {} \;
rm: remove regular file `./-l'? #
As you can see, it is directly showing next command prompt without waiting for me to provide any input.
Solved! Go to Solution.
- Tags:
- find
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-20-2006 09:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-20-2006 09:22 PM
тАО03-20-2006 09:22 PM
Re: find . -inum 3232 -exec rm -i {} \;
for file in `find . -inum 3232`; do
rm -i $file
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-20-2006 09:23 PM
тАО03-20-2006 09:23 PM
Re: find . -inum 3232 -exec rm -i {} \;
find . -inum 3232 -exec rm -i "{}" \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-20-2006 09:23 PM
тАО03-20-2006 09:23 PM
Re: find . -inum 3232 -exec rm -i {} \;
Why not using directly :
find . -inum 3232 -ok rm {} \;
normally it should prompt you for accepting or not the command. look at the man page.
Regards
Pat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-20-2006 09:25 PM
тАО03-20-2006 09:25 PM
Re: find . -inum 3232 -exec rm -i {} \;
You can do this way,
# cat test.sh
for remove_file in `ind . -inum 3232`
do
rm -i $remove_file
done
# chmod 755 test.sh
# ./test.sh
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-20-2006 09:30 PM
тАО03-20-2006 09:30 PM
Re: find . -inum 3232 -exec rm -i {} \;
# rm -i `find . -inum 3232`
will help you out.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-20-2006 09:38 PM
тАО03-20-2006 09:38 PM
Re: find . -inum 3232 -exec rm -i {} \;
I tried this.
# find . -inum 2275 -xdev -exec mv {} rj \;
find: warning: you have specified the -xdev option after a non-option argument -inum, but options are not positional (-xdev affects tests specified before it as well as those specified after it). Please specify options before other arguments.
# ls
rj
It seems it is working but, giving some warning messgaes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-20-2006 09:44 PM
тАО03-20-2006 09:44 PM
Re: find . -inum 3232 -exec rm -i {} \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-20-2006 09:46 PM
тАО03-20-2006 09:46 PM
Re: find . -inum 3232 -exec rm -i {} \;
Thanks for instant replay.
The same can be accomplished with
1. for f in `find . -inum 2275`
do
rm -i $f
done
2. rm -i `find . -inum 3232`
3. find . -inum 3232 -ok rm {} \;
4. find . -inum 3232 -xdev -exec mv {} rj\;
Thanks a lot.