[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Suggestion: verbose option. Doc Update: -print and no action are NOT the
Suggestion: verbose option. Doc Update: -print and no action are NOT the same
Mon, 28 Mar 2011 17:22:20 -0500
KMail/1.12.4 (Linux/22.214.171.124-0.2-desktop; KDE/4.3.5; x86_64; ; )
I have a suggestion and documentation update for `find`.
The suggestion for findutils' find is to add a '-t, --verbose' or '--whatif'
option similar to the '-t' in `xargs`. At a minimum it would show what `find`
would generate, but it would not execute anything. Note: The `-D exec` option
displayed no additional output.
The documentation update is to add a paragraph describing that using the
default action of `-print` may NOT produce the same result as actually
supplying the action `-print` because of Boolean operator precedence.
find -name tmp -prune -o -name \*.txt
find -name tmp -prune -o -name \*.txt -print
The lack of an action in the first command means it is equivalent to:
find . \( -name tmp -prune -o -name \*.txt \) -print
This causes tmp to be included in the output. However for the second find
command the normal rules of Boolean operator precedence apply, so the pruned
directory does not appear in the output.
As described here: http://content.hccfl.edu/pollock/unix/findcmd.htm
find (GNU findutils) 4.4.0
|[Prev in Thread]
||[Next in Thread]|
- Suggestion: verbose option. Doc Update: -print and no action are NOT the same,
Peggy Russell <=