Re: How to kill a dir?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2004-01-05 at 13:10, WipeOut wrote:
> Quillen, Channon wrote:
> 
> > Try placing the directory name in quotes "" or single quotes ''
> > Eg. rm -fr "test"
> >
> > -Channon
> >
> 
> Nope, that didn't help..
> 
> Thanks for trying..

    OK, time to get out the power tools. (I can't believe no one's
thrown this in already...)

    ls -lai  <----notice that the 'i' is included. Sample:

  Inum:   Perms                             Size, etc...
 968014 -rw-rw-r--    1 brian    brian     3885999 Dec 24 15:12 ximian-artwork-0.2.26-1.i386.rpm
 968013 -rw-rw-r--    1 brian    brian      327381 Dec 24 15:11 xmms-status-plugin-1.0-2.i386.rpm
 968015 -rw-rw-r--    1 brian    brian      320725 Dec 24 15:12 xscorch-0.1.16-0.1pre2.i386.rpm
 968016 -rw-rw-r--    1 brian    brian      441488 Dec 24 15:12 zsnes-1.36-3.i386.rpm

    Find the directory/file by it's inode number, then

    find . -inum 968016 -exec rm {} \;

    If it's a directory, (and it's empty) whatever 'find' finds it'll
run the command on, such as removing the 'znes' rpm above.  As far as I
know, this'll work on any file or directory, unless the attributes are
changed (like in the previous posts, using chattr) or unless the thing's
a directory that isn't empty.

    Enjoy!

-- 
------------------------------------------------------------------------
Brian FahrlÃnder                 Researcher, Conservative, and Technomad
Evansville, IN                                     http://Fahrlander.net
ICQ  5119262              Microsoft never invented email; that was Unix.
------------------------------------------------------------------------

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux