-depth option for find(1)

Andrew Klossner andrew at orca.UUCP
Thu Aug 18 01:07:28 AEST 1983


	"This option causes find to perform a 'form' of depth first
	search through the directory tree; all entries in a directory
	will be expanded before the directory name is found."

It needs to be said.  Both methods of walking the directory tree, where
directories are visited before or after their files, are forms of
depth-first search.  The complement to depth-first is breadth-first,
where you open all the top-level directories, followed by all the files
named in those directories, followed by all the files named in all the
directories named in those directories, etc.

Visiting directories before their descendants is called a "pre-order
walk" of the directory tree.  Visiting directories after their
descendants is called a "post-order walk".  There's also an "in-order"
walk, where you visit the first file in the directory, then the
directory, then the rest of its files, but that's not very useful
unless the tree is binary.

  -- Andrew Klossner   (decvax!tektronix!tekecs!andrew)  [UUCP]
                       (andrew.tektronix at rand-relay)     [ARPA]



More information about the Comp.unix.wizards mailing list