Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/26/83; site ihnp4.UUCP Path: utzoo!linus!decvax!harpo!eagle!mhuxt!mhuxi!mhuxa!houxm!ihnp4!tsclark From: tsclark@ihnp4.UUCP Newsgroups: net.unix-wizards Subject: Re: -depth option for find(1) Message-ID: <415@ihnp4.UUCP> Date: Tue, 16-Aug-83 11:50:28 EDT Article-I.D.: ihnp4.415 Posted: Tue Aug 16 11:50:28 1983 Date-Received: Wed, 17-Aug-83 03:44:33 EDT References: <352@hou5f.UUCP>, <440@spanky.UUCP> Organization: BTL Naperville, Il. Lines: 31 Ok...here's what "find -depth" REALLY does, and why it is a good thing: Normally, if you use find on a directory tree, it prints the name of the directory followed by the contents of that directory (recursively). That is, it prints as it goes down the tree. For example: top top/second top/second/third top/second/file top/file etc. This is good if you are copying files since you would like the directory created before you try to put anything in it. What the -depth option does is list the contents of the directory first, and then later give the name of the directory, such as: top/second/third top/second/file top/second top/file top This is good if you don't want to change the directory until you've changed everything inside it. For instance: find . -depth -exec rm {} \; (same as rm -r .) find . -depth -exec chown otheruser {} \; I know it's not documented in the System V manual -- I submitted an MR on this and it will be documented in the next issue (I believe).