Montag, 19. August 2013

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   

Keine Kommentare:

Kommentar veröffentlichen