Accessing files by inode #s

Jim jjw at celerity.UUCP
Fri Jan 29 07:58:28 AEST 1988


In article <11470 at brl-adm.ARPA> iunix1 at almsa-1.arpa (Will Martin) asks:
>Is there some trick I just don't know that would allow me to refer to a
>file by its inode # in performing otherwise-ordinary UNIX commands,
>like "cp" or "rm"? Or have people written special commands that will do
>this sort of thing? 

And in article <831 at dolqci.UUCP> stein at dolqci.UUCP (Mike Stein) responds:
>     Yes!  You can do anything you want via
>
>          find <path> -inum <inode> -exec <command> \;

***********************************************************************
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
***********************************************************************

The find will traverse file mount points so you may locate files in file
systems other than the one you are interested in.  Be especially careful
with using "rm -f" as the command.

It is possible to use "-ok" instead of "-exec" which will ask if you want
the operation to be performed when the file(s) are located.  However the
"find" can take a long time on large file systems.

					-- J. J. Whelan



More information about the Comp.unix.questions mailing list