Finding files with find

find is the Swiss Army Knife tool for quickly finding files from the command line, but its syntax is somewhat unusual. Here are some quick examples:

  •  list all files with ls that were modified within the last 15 days:

     find ./ -type f -mtime -15 | xargs ls -l  

  •  list all files whose name contains "test":

     find ./ -type f -name "*test"   

  •  grep for OUR in all files modified within the last 15 days

     find ./ -type f -mtime -15|xargs grep OUR   


184 Words

2013-08-19T00:54:00.004-07:00