Difference between revisions of "cmd/find"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< cmd
Jump to navigation Jump to search
 
Line 20: Line 20:
  
 
Note that <code>-name</code> is case-sensitive; use <code>-iname</code> for case-agnostic.
 
Note that <code>-name</code> is case-sensitive; use <code>-iname</code> for case-agnostic.
 +
 +
Find all files over 1 gigabyte in size:
 +
: <syntaxhighlight inline lang=bash>find -size +1G</syntaxhighlight>

Latest revision as of 14:41, 21 July 2025

About

The find 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:

find -name kate

Find all files or folders with the extension ".txt":

find -name *.txt

View, in realtime, all additions to any file whose extension is ".log":

find . -name "*.log" | xargs tail -f

(This is useful for monitoring web server (e.g. Apache) activity.)

Note that -name is case-sensitive; use -iname for case-agnostic.

Find all files over 1 gigabyte in size:

find -size +1G