File remove command?

D'Arcy J.M. Cain darcy at druid.uucp
Mon Jun 17 00:22:35 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 .....

Don't try this at home kiddies.  Not every filesystem is mounted on root.
For example here is my system:

      /         :	Disk space:  20.54 MB of  31.64 MB available (64.95%).
      /usr      :	Disk space:  24.24 MB of 226.75 MB available (10.69%).
/usr/spool/news :	Disk space:  20.94 MB of  47.19 MB available (44.38%).

Now if I want to get rid of /usr/darcy/file and its inode is 397 I better
not try the above suggestion because there may be a file on my news
partition with the same inode number.

-- 
D'Arcy J.M. Cain (darcy at druid)     |
D'Arcy Cain Consulting             |   There's no government
Toronto, Ontario, Canada           |   like no government!
+1 416 424 2871                    |



More information about the Comp.unix.shell mailing list