Commande pour trouver un fichier ou un répertoire dans le répertoire actuel
find . -name 'filename or wildcard'
# Example;
find . -name '*.js'
# -name is case sensitive.
# To find using name irrespective of case (case insensitive) use the option -name
# Example;
find . -type f -iname 'F*'
# for files only (ignore directories) -type f
# for directories only -type d
# for symbolic links -type l
# Example;
find . -name -type d '*E*'
# To find using the -or operator
find . -name -type d '*E*' -or -name 'F*'
# To find by size; e.g
# files larger than 100KB
find . -type f -size +100k
# files less than 20GB
find . -type f -size -20G
# files larger than 100MB but less than 250MB
find . -type f -size +100M -size -250M
# To find by time; e.g
# files edited more than 2 days alongside
find . -type f -mtime +2
# files edited within the last 3 days
find . -type f -mtime -3
# files edited in the last 24 hours
find . -type f -mtime -1
# To delete the file(s) after finding, simply add -delete after the command
# e.g; To delete all files edited less than 3 days ago;
find . -type f -mtime -3 -delete
# To execute additional commands on the result of find command,
# use the -exec option as below
find . -type f -size +100M -size -250M -exec ls -l {} \;
Chris Nzoka-okoye