[net.bugs.usg] find -inum option undocumented

dennis@rlgvax.UUCP (Dennis Bednar) (07/04/86)

The -inum option of find(1) which finds files based on
i-node number is undocumented in the man pages.

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

gwyn@brl-smoke.ARPA (Doug Gwyn ) (07/05/86)

In article <1036@rlgvax.UUCP> dennis@rlgvax.UUCP (Dennis Bednar) writes:
>By the way, what does the -depth option of find do?

Forces a depth-first traversal of the directory hierarchy.
The main value of this is that a later restore using cpio
can handle read-only diretories properly, since they'll
not be made read-only until all their files are in place.

>Also the man page for find doesn't describe -depth either.

Whose manual?  I think it's in the current one from AT&T.

geoff@desint.UUCP (Geoff Kuenning) (07/08/86)

In article <1036@rlgvax.UUCP> dennis@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

mikel@codas.UUCP (07/09/86)

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

guy@sun.UUCP (07/10/86)

> 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
	guy@sun.com (or guy@sun.arpa)

glen@proexam.UUCP (07/14/86)

In article <625@codas.ATT.UUCP> mikel@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@steinmetz.UUCP (Davidsen) (08/04/86)

In article <232@desint.UUCP> geoff@desint.UUCP (Geoff Kuenning) writes:
>In article <1036@rlgvax.UUCP> dennis@rlgvax.UUCP (Dennis Bednar) writes:
>
>> 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.

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 ---------------------/        (davidsen@ge-crd.ARPA)

"Stupidity, like virtue, is its own reward"

simon@einode.UUCP (Simon Kenyon) (08/11/86)

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

they have been missing from the manual for an awfully long time.
(back when system V was just plain ole system V - no releases, no versions,
no technologies)
surprised this hasen't cropped up before :-)
-- 
Simon Kenyon			The National Software Centre, Dublin, IRELAND
simon@einode.UUCP						+353-1-716255
EEEK /dev/mouse escaped (Glad to see my competition went down well at USENIX)