find#
Command Line Options#
. is the location you want to search, any folder or . for the current directory
Find specific filename#
find . -name filename
Find file/dir with sometext in the name:#
find . -iname "*sometext*"
Only find files:#
find . -type f
Only find directories:#
find . -type d
Find files modified over 2 days ago:#
find . -mtime +2
Find files modified in the last 2 minutes:#
find . -mmin -2
Find files accessed in the last 2 minutes:#
find . -amin -2
Delete all results found (only works on files and does not prompt for confirmation):#
find . -type f -delete
Execute a command on each item found (The {} is the filename):#
find . -iname "Wedding*" -exec stat {} \;
Limit the folder depth to search to 1:#
find . -maxdepth -type f
Find files with specific size in bytes:#
find . -size 0