req: New feature to rm? Remove file by the inode number
I couldn't find a way to remove files that had scandic/non-printable letters, then i remembered ls showed inode number of the file. Is it possible to remove the file by the inode number? It would be a useful feature :) I bet there is a way to remove those files, but only third party programs came to my mind. Cheers, Erik. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: req: New feature to rm? Remove file by the inode number
On Thu, May 05, 2005 at 02:19:41PM +0300, Erik Udo wrote: I couldn't find a way to remove files that had scandic/non-printable letters, then i remembered ls showed inode number of the file. Is it possible to remove the file by the inode number? It would be a useful feature :) I bet there is a way to remove those files, but only third party programs came to my mind. find(1) with -inum and -delete would do the trick. Tim ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: req: New feature to rm? Remove file by the inode number
On Thu, May 05, 2005 at 02:19:41PM +0300, Erik Udo wrote.. I couldn't find a way to remove files that had scandic/non-printable letters, then i remembered ls showed inode number of the file. Is it possible to remove the file by the inode number? It would be a useful feature :) I bet there is a way to remove those files, but only third party programs came to my mind. If you want do to it the hard way: clri(8) :-) -- Wilko Bulte [EMAIL PROTECTED] ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: req: New feature to rm? Remove file by the inode number
I couldn't find a way to remove files that had scandic/non-printable letters, then i remembered ls showed inode number of the file. Is it possible to remove the file by the inode number? It would be a useful feature :) I bet there is a way to remove those files, but only third party programs came to my mind. I think the -inum option of the find(1) utility can do the trick. -- -jpeg. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: req: New feature to rm? Remove file by the inode number
Wilko Bulte wrote: On Thu, May 05, 2005 at 02:19:41PM +0300, Erik Udo wrote.. I couldn't find a way to remove files that had scandic/non-printable letters, then i remembered ls showed inode number of the file. Is it possible to remove the file by the inode number? It would be a useful feature :) I bet there is a way to remove those files, but only third party programs came to my mind. If you want do to it the hard way: clri(8) :-) Thanks! I'll use clri for this. It would still be a nice feature in rm, after all, i dont think it's that hard to make. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: req: New feature to rm? Remove file by the inode number
Julien Gabel wrote: I couldn't find a way to remove files that had scandic/non-printable letters, then i remembered ls showed inode number of the file. Is it possible to remove the file by the inode number? It would be a useful feature :) I bet there is a way to remove those files, but only third party programs came to my mind. I think the -inum option of the find(1) utility can do the trick. After trying clri, maybe find(1) is a better way :). I can imagine what would happen when i would use clri on wrong slice :) ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: req: New feature to rm? Remove file by the inode number
Julien Gabel wrote: I couldn't find a way to remove files that had scandic/non-printable letters, then i remembered ls showed inode number of the file. Is it possible to remove the file by the inode number? It would be a useful feature :) I bet there is a way to remove those files, but only third party programs came to my mind. I think the -inum option of the find(1) utility can do the trick. After trying clri, maybe find(1) is a better way :). I can imagine what would happen when i would use clri on wrong slice :) i haven't seen/used clri in years (maybe decades), but if memory doesn't fail, clri just zeroes the inode, the blocks are not returned to the freelist! and if it's a directory things can get nasty. my .5$ danny ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: req: New feature to rm? Remove file by the inode number
On Thu, May 05, 2005 at 03:24:25PM +0300, Danny Braniss wrote.. Julien Gabel wrote: I couldn't find a way to remove files that had scandic/non-printable letters, then i remembered ls showed inode number of the file. Is it possible to remove the file by the inode number? It would be a useful feature :) I bet there is a way to remove those files, but only third party programs came to my mind. I think the -inum option of the find(1) utility can do the trick. After trying clri, maybe find(1) is a better way :). I can imagine what would happen when i would use clri on wrong slice :) i haven't seen/used clri in years (maybe decades), but if memory doesn't fail, clri just zeroes the inode, the blocks are not returned to the freelist! and if it's a directory things can get nasty. man clri(8) tells you all about that.. -- Wilko Bulte [EMAIL PROTECTED] ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: req: New feature to rm? Remove file by the inode number
Erik Udo writes: I couldn't find a way to remove files that had scandic/non-printable letters, then i remembered ls showed inode number of the file. Is it possible to remove the file by the inode number? It would be a useful feature :) I bet there is a way to remove those files, but only third party programs came to my mind. How about rm -i ./*? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: req: New feature to rm? Remove file by the inode number
On Thu, May 05, 2005 at 02:47:55PM +0300, Erik Udo wrote: Wilko Bulte wrote: On Thu, May 05, 2005 at 02:19:41PM +0300, Erik Udo wrote.. I couldn't find a way to remove files that had scandic/non-printable letters, then i remembered ls showed inode number of the file. Is it possible to remove the file by the inode number? It would be a useful feature :) I bet there is a way to remove those files, but only third party programs came to my mind. If you want do to it the hard way: clri(8) :-) Thanks! I'll use clri for this. It would still be a nice feature in rm, after all, i dont think it's that hard to make. Way overkill. find . -mindepth 1 -maxdepth 1 -inum inode -- Brian Fundakowski Feldman \'[ FreeBSD ]''\ [EMAIL PROTECTED] \ The Power to Serve! \ Opinions expressed are my own. \,,\ ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: req: New feature to rm? Remove file by the inode number
A couple of observations: 1) Implicit in most people's answers is the fact that a single inode can have many directory entries. That's why find is used. That's also why the solution below won't work, as it doesn't check the entire file system (nor would you want to answer y/n for all those files :) 2) The same inode number can exist for multiple files in a system. This occurs if multiple file systems exist. So, if you use find to achieve the desired effect, be very sure that you run it from the root of the target file system and that you tell it not to traverse onto other file systems. If you run it from the root directory, you're very likely to delete one or more files you didn't mean to delete. Point 2, likely as not, might explain why there's no simple mechanism for doing this from rm. At the very least you'd have to specify the file system you're referring to, and many plain users couldn't do that safely. Those that can are probably able to use find anyway. Cheers, Simon --- Raymond Wiker [EMAIL PROTECTED] wrote: Erik Udo writes: I couldn't find a way to remove files that had scandic/non-printable letters, then i remembered ls showed inode number of the file. Is it possible to remove the file by the inode number? It would be a useful feature :) I bet there is a way to remove those files, but only third party programs came to my mind. How about rm -i ./*? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED] __ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: req: New feature to rm? Remove file by the inode number
--- Simon Roberts [EMAIL PROTECTED] wrote: A couple of observations: [snip] [snip] Point 2, likely as not, might explain why there's no simple mechanism for doing this from rm. At the very least you'd have to specify the file system you're referring to, and many plain users couldn't do that safely. Those that can are probably able to use find anyway. A (device no, inode no) can uniquely identify a file -but then it requires the same amt of traversals (from the root directory's inode) that any other utility does. Im not sure rm can optimize anything that a find .. -exec rm {} \; would. Cheers, Simon --- Raymond Wiker [EMAIL PROTECTED] wrote: Erik Udo writes: I couldn't find a way to remove files that had scandic/non-printable letters, then i remembered ls showed inode number of the file. Is it possible to remove the file by the inode number? It would be a useful feature :) I bet there is a way to remove those files, but only third party programs came to my mind. How about rm -i ./*? The POSIX std requires -i to be used for 'interactive' (and even if it didn't that is already the case on most unix systems). regards -kamal ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED] __ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED] Kamal R. Prasad UNIX systems consultant [EMAIL PROTECTED] In theory, there is no difference between theory and practice. In practice, there is:-). Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: req: New feature to rm? Remove file by the inode number
Kamal R. Prasad writes: --- Raymond Wiker [EMAIL PROTECTED] wrote: Erik Udo writes: I couldn't find a way to remove files that had scandic/non-printable letters, then i remembered ls showed inode number of the file. Is it possible to remove the file by the inode number? It would be a useful feature :) I bet there is a way to remove those files, but only third party programs came to my mind. How about rm -i ./*? The POSIX std requires -i to be used for 'interactive' (and even if it didn't that is already the case on most unix systems). That's exactly the way I meant this to be used... if you use the command rm -i ./* you will be asked for each file whether you want to remove it (except for files beginning with ., of course). I don't see this as more cumbersome than using ls -i to get a list of inodes, and then using clri or whatever to remove the inode; which operation is probably the wrong solution anyway, as there may be other directory entries that point to the same inode, and which should be allowed to do so even after the unwanted directory entries have been removed. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: req: New feature to rm? Remove file by the inode number
Point 2, likely as not, might explain why there's no simple mechanism for doing this from rm. At the very least you'd have to specify the file system you're referring to, and many plain users couldn't do that safely. Those that can are probably able to use find anyway. A (device no, inode no) can uniquely identify a file -but then it requires the same amt of traversals (from the root directory's inode) that any other utility does. Im not sure rm can optimize anything that a find .. -exec rm {} \; would. Or find [...] -print | xargs \rm to bypass some problem with a very long list of files to delete. -- -jpeg. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: req: New feature to rm? Remove file by the inode number
My point of view is if you add inode removing option to the rm you'll have to add en extra parameter, that is on which *filesystem*. For example, rm -x 2 /var, i am supposing -x as the option for removing inodes is removing inode number 2 on file system /var So the pattern seems to be a little confusing since, at a first glance, it looks like you are removing /var directory. Some dummy users may or may not be confused. Because of general purpose of rm is basically removing directory entries, Adding an extra inode option and specifying a pattern as above is a little misaiming of rm. No necessasity. We'd better let third programs achieve such a will. clri and find will be sufficient. Sincerely. P.S: What i've written above is not related to the replied message. I only replied to be in the thread. On Thursday 05 May 2005 16:55, Julien Gabel wrote: Point 2, likely as not, might explain why there's no simple mechanism for doing this from rm. At the very least you'd have to specify the file system you're referring to, and many plain users couldn't do that safely. Those that can are probably able to use find anyway. A (device no, inode no) can uniquely identify a file -but then it requires the same amt of traversals (from the root directory's inode) that any other utility does. Im not sure rm can optimize anything that a find .. -exec rm {} \; would. Or find [...] -print | xargs \rm to bypass some problem with a very long list of files to delete. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: req: New feature to rm? Remove file by the inode number
At 2:19 PM +0300 5/5/05, Erik Udo wrote: I couldn't find a way to remove files that had scandic/non-printable letters, then i remembered ls showed inode number of the file. Is it possible to remove the file by the inode number? It would be a useful feature :) It would be a bad feature, at least for the problem you are trying to solve. You are trying to remove one specific filename from one specific directory. It is possible to link multiple filenames to the exact same file (inode). If a file has multiple links to it, then you would want to remove only the filename you're looking at, and not all filenames in the filesystem which might have the same inode. Other solutions, with 'find' or 'rm -i ./*', are more correct for the situation you are looking at. Note that if a file only has *some* unprintable characters, and also has some standard characters, then you can use pattern-matching to reduce how many fines would be matched by 'rm -i'. Something like: rm -i ./*blah* I have been in similar situations to what you're describing, and I've never had to do more than pick a reasonable filename pattern and combine it with -i (-i for interactive, so it prompts you for each file before removing it). -- Garance Alistair Drosehn= [EMAIL PROTECTED] Senior Systems Programmer or [EMAIL PROTECTED] Rensselaer Polytechnic Instituteor [EMAIL PROTECTED] ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: req: New feature to rm? Remove file by the inode number
Julien Gabel wrote this message on Thu, May 05, 2005 at 18:55 +0200: Point 2, likely as not, might explain why there's no simple mechanism for doing this from rm. At the very least you'd have to specify the file system you're referring to, and many plain users couldn't do that safely. Those that can are probably able to use find anyway. A (device no, inode no) can uniquely identify a file -but then it requires the same amt of traversals (from the root directory's inode) that any other utility does. Im not sure rm can optimize anything that a find .. -exec rm {} \; would. Or find [...] -print | xargs \rm to bypass some problem with a very long list of files to delete. Please make that: find [...] -print0 | xargs -0 rm otherwise whitespace characters can cause problems... of course find does have the -delete option which makes such mangling unnecessary.. -- John-Mark Gurney Voice: +1 415 225 5579 All that I will do, has been done, All that I have, has not. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]