Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Find (Unix)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Operators=== Operators can be used to enhance the expressions of the find command. Operators are listed in order of decreasing precedence: * <code>( expr )</code>: forces precedence; * <code>! expr</code>: true if {{code|expr}} is false; * <code>expr1 expr2</code> (or <code>expr1 -a expr2</code>): AND. {{code|expr2}} is not evaluated if {{code|expr1}} is false; * <code>expr1 -o expr2</code>: OR. {{code|expr2}} is not evaluated if {{code|expr1}} is true. <syntaxhighlight lang="console"> $ find . -name 'fileA_*' -o -name 'fileB_*' </syntaxhighlight> This command searches the current working directory tree for files whose names start with {{code|fileA_}} or {{code|fileB_}}. We quote the {{code|fileA_*}} so that the shell does not expand it. <syntaxhighlight lang="console"> $ find . -name 'foo.cpp' '!' -path '.svn' </syntaxhighlight> This command searches the current working directory tree except the subdirectory tree ".svn" for files whose name is "foo.cpp". We quote the <code>!</code> so that it's not interpreted by the shell as the history substitution character.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)