Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

find -inum option undocumented

3 views
Skip to first unread message

Geoff Kuenning

unread,
Jul 8, 1986, 4:48:35 PM7/8/86
to
In article <10...@rlgvax.UUCP> den...@rlgvax.UUCP (Dennis Bednar) writes:

> 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

mi...@codas.uucp

unread,
Jul 9, 1986, 4:48:52 PM7/9/86
to
> 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.
>
> -Dennis Bednar
> {decvax,ihnp4,harpo,allegra}!seismo!rlgvax!dennis UUCP

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
| . |
\\-------//

g...@sun.uucp

unread,
Jul 10, 1986, 2:58:55 PM7/10/86
to
> 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.

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)

gl...@proexam.uucp

unread,
Jul 14, 1986, 10:40:51 AM7/14/86
to
In article <6...@codas.ATT.UUCP> mi...@codas.UUCP writes:
>
>" -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."
>--

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

Davidsen

unread,
Aug 4, 1986, 12:52:11 PM8/4/86
to

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"

0 new messages