Difference between revisions of "cmd/find"
< cmd
Jump to navigation
Jump to search
(another example; syntax highlighting) |
(brief explanation) |
||
Line 5: | Line 5: | ||
</hide> | </hide> | ||
==About== | ==About== | ||
− | + | The '''find''' [[Linux]] [[Linux/commands|command]] searches directory trees for files whose directory information meets particular criteria. | |
+ | |||
+ | To search by content, use [[grep]]. | ||
==Examples== | ==Examples== | ||
Find a file or folder named "kate" somewhere under the current folder: | Find a file or folder named "kate" somewhere under the current folder: |
Revision as of 15:58, 17 May 2015
About
The find Linux command searches directory trees for files whose directory information meets particular criteria.
To search by content, use grep.
Examples
Find a file or folder named "kate" somewhere under the current folder:
- <bash>find -name kate</bash>
Find all files or folders with the extension ".txt":
- <bash>find -name *.txt</bash>
View, in realtime, all additions to any file whose extension is ".log":
- <bash>find . -name "*.log" | xargs tail -f</bash>
(This is useful for monitoring web server (e.g. Apache) activity.)