find – recursively walk a file hierarchy
SYNOPSIS
find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]
find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression]- find all files under current directory
find . - specify a directory, e.g. the user home directory
find ~
- find only directories
find . -type d - or find only files
find . -type f
- find all txt files
find . -type f -name "*.txt"
- use
-inameto ignore name sensitivefind . -type f -iname "*.txt"
- find all files modified in last 10 minutes ( less than )
find . -type f -mmin -10 - Combine! find all files modified more than 1 minute, but less than 5 minutes
find . -type f -mmin +1 -mmin -5 - replace
mminwithmtimeif you want usedayinstead ofminute.
- find all files which file size is over 5M
find . -type f -size +5M
find . -perm 755- find all markdown files in only current directory
find . -type f -name "*.md" -maxdepth 1