Linux

How to find files in Linux

find / -name ‘myfile’

search from the root directory for the file named myfile

 

find /home -iname ‘tes*’

search from the home directory for files that their name starts with tes

 

find /home -name ‘*.bak’ -size -10000k

search from the home directory for bak files that their size is less than 10MB

 

find /home -name ‘*.mp3’ -o -name ‘*.avi’

search from the home directory for mpe3 files and avi files

 

find /home -iname ‘*.mp3’

search from the home directory for mpe3 files (Case-insensitive search)

 

find /home/ -name ‘*.txt’ -mtime -3

search from the home directory for txt files modified less than 3 days