File remove command?
Derek E. Terveer
det at hawkmoon.MN.ORG
Mon Jun 17 15:07:47 AEST 1991
>In article <1991Jun15.210940.18999 at cbnews.cb.att.com> ask at cblph.att.com writes:
>So, you now want to remove all files with inumber 397
>You need to know the root directory of your filesystem
>(use the /etc/mount or df command to find out if you are unsure)
>Then do a find and remove all occurences of that inumber
>$ cd /usrc # /usrc is the filesystem containing the files
>$ find . -inum 397 -exec rm {} \;
>Caution: inumbers are not unique in your system; only in your
> filesystem. So it's a very bad idea to do a
> find / -inum 397 .....
Howver, depending on the system and the particular find command, not every find
command has "-inum" as an option. I know that the GNU find command has this;
howver, the more recent System V Unixen have the -xdev (GNU find) or -mount
(System V) option to restrict the search to the implied (by the pathname, "."
in your example) file system.
If you don't have "-inum" you could, as root, use "ff /dev/rdsk/? | grep 397"
to find the file belonging to that inode. Then remove it. See ff(1) and
find(1) in the FM.
derek
--
Derek "Tigger" Terveer det at hawkmoon.MN.ORG -- U of MN Women's Lax
I am the way and the truth and the light, I know all the answers; don't need
your advice. -- "I am the way and the truth and the light" -- The Legendary Pink Dots
More information about the Comp.unix.shell
mailing list