> The -inum option of find(1) which finds files based on
> i-node number is undocumented in the man pages.
This is true. However, the BUGS section should mention that, for almost
all applications, ncheck(1m) is a much better way to locate a file based
on its i-node number.
> By the way, what does the -depth option of find do?
> The man page for cpio attempts to explain what the -depth
> option of find does, but I'm confused.
>
> Also the man page for find doesn't describe -depth either.
The -depth option changes the behavior of "find / -print" so that the
name of a directory is printed *after* the contents, instead of before.
In data-structure terminology, it changes the directory tree search from
preorder to postorder. It is useful with cpio because, with the -m switch,
it causes the directory's modification time to be updated *after* all files
have been placed in it--otherwise, placing the next file would wipe out that
carefully-preserved mod time.
--
Geoff Kuenning
{hplabs,ihnp4}!trwrb!desint!geoff
From my man page from "AT&T 3B2 Computer Unix System V User Reference Manual"
" -depth Always true; causes descent of the directory hierarchy to
be done so that all entries in a directory are acted on
before the directory itself. This can be helpful when _ f_ i_ n_ d
is used with _ c_ p_ i_ o_ (_ 1_ ) to transfer files that are contained
in directories without write permission."
--
___
/ \ Mikel Manitius @ AT&T-IS Altamonte Springs, FL
| RPI | ...{seismo!akgua|ihnp4|cbosgd|mcnc}!codas!mikel
| . |
\\-------//
Only if you have read permission on the partition containing the file system
you're searching - which normal users will not have if the system
administrator is sane. In most cases, it is the administrator who's
searching for that file, so this is not a problem. (Then again, I can't
remember the last time I searched for a file by i-number anyway.)
--
Guy Harris
{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
g...@sun.com (or g...@sun.arpa)
Another use for this option is to clean out your disk directory hierarchy of
directories, empty except for other directories.
find / -depth -type d -exec rmdir >& /dev/null
or better:
find / -depth -type d -print | xargs rmdir >& /dev/null
I learn something every day! I admit to not using the mod time on
directories much, but I never thought of this. I always thought it was
to allow restoring a directory which is read-only, by creating it by
default (-d) and then fixing the permissions later. I have a few things
in directories which are mode 555 and don't create well on a new system
without -depth. Hope someone else learned something, too.
--
-bill davidsen
ihnp4!seismo!rochester!steinmetz!--\
\
unirot ------------->---> crdos1!davidsen
chinet ------/
sixhub ---------------------/ (davi...@ge-crd.ARPA)
"Stupidity, like virtue, is its own reward"