File remove command?

Tom Christiansen tchrist at convex.COM
Mon Jun 17 22:37:27 AEST 1991


>From the keyboard of det at hawkmoon.MN.ORG (Derek E. Terveer):
:>$ 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.

Isn't inconsistency wonderful?  This is why I'd suggest putting up GNU
find everywhere.  That way you can count on what options are there.
Another possibility is to run it through the find2perl translator,
which accepts such options even if your system doesn't.

--tom
--
Tom Christiansen		tchrist at convex.com	convex!tchrist
		"So much mail, so little time."  



More information about the Comp.unix.shell mailing list