Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!virtech!cpcahil From: cpcahil@virtech.uucp (Conor P. Cahill) Newsgroups: comp.unix.questions Subject: Re: find command Message-ID: <1989Nov28.043652.4994@virtech.uucp> Date: 28 Nov 89 04:36:52 GMT References: <21544@adm.BRL.MIL> Organization: Virtual Technologies Inc. Lines: 41 In article <21544@adm.BRL.MIL>, mchinni@pica.army.mil (Michael J. Chinni, SMCAR-CCS-E) writes: > I was reading an article in a magazine, and the article was talking about the > find command. It mentioned as an example: find / -depth -print > > Now I have RTFM (both on BSD-based systems and SysV-based system) and > I can find no option -depth, furthermore, when I try the example I get: > find: bad option < -depth > The "-depth" option to find, where it is supported, tells find to visit all files in the directory before visiting the directory itself. This is needed for the following scenario: Directory A exists and has files in it. Normal Find -print Find -depth -print A A/file1 A/file1 A/file2... A/file2... A Note that the directory itself (A) is listed last. I only have read access to A. I am not a super user. I want to restore a backup of A. If the backup was made with standard find (i.e. "-depth" not specified) then my cpio backup will have the directory on the tape before the files within the directory. The directory will be created and set to read-only and I will then be unable to restore the files. If the -depth is specified the directory will be created, but with my ownership and standard modes when the files are restored and then the modes and ownership of the directory will be modified to match those on the tape. -- +-----------------------------------------------------------------------+ | Conor P. Cahill uunet!virtech!cpcahil 703-430-9247 ! | Virtual Technologies Inc., P. O. Box 876, Sterling, VA 22170 | +-----------------------------------------------------------------------+