Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 102821 - option "-prune" of "find" command doesn't work as it is described in the manual
option "-prune" of "find" command doesn't work as it is described in the manual
Product: Red Hat Linux
Classification: Retired
Component: findutils (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2003-08-21 10:48 EDT by Luke
Modified: 2007-04-18 12:57 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-08-21 11:04:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Luke 2003-08-21 10:48:23 EDT

Option "-prune" of "find" command doesn't work (as it is described in the find 

In the find manual one can read:

  -path pattern
         File name matches shell pattern pattern. The metacharacters do
         not treat '/' or '.' specially; so, for example,
                   find . -path './sr*sc'
             will  print an entry for a directory called './src/misc' (if one
         exists).  To ignore a whole directory tree,  use  -prune rather
         than  checking every file in the tree.  For example, to skip the
         directory '/src/emacs/' and all files and  directories under  it,
         and  print the names of the other files found, do something like
                   find . -path './src/emacs' -prune -o -print

I have made the appropriate directory tree ('/src/emacs/' and directories under 
it) and I have issued the command:

    find . -path './src/emacs' -prune -o -print

This command has printed also the directory '/src/emacs/' and all files and 
directories under it - it shouldn't do so.

Version-Release number of selected component (if applicable):

Comment 1 Tim Waugh 2003-08-21 11:04:48 EDT
Works for me:

$ for a in a b c; do mkdir $a; touch $a/file; done
$ mkdir -p src/emacs; touch src/emacs/file
$ find . -path './src/emacs' -prune -o -print

Note You need to log in before you can comment on or make changes to this bug.