cmd/find: Difference between revisions

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
m slight correction
another example; syntax highlighting
Line 8: Line 8:
==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:
: <code>find -name kate</code>
: <bash>find -name kate</bash>


Find all files or folders with the extension ".txt":
Find all files or folders with the extension ".txt":
: <code>find -name *.txt</code>
: <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 web server|Apache]]) activity.)
==Links==
==Links==
===Reference===
===Reference===
* {{l/manpage}}
* {{l/manpage}}

Revision as of 15:50, 17 May 2015

<hide> page type::manual thing type::command platform::Linux </hide>

About

  1. redirect Template:seed

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.)

Reference