Posted By

johnloy on 06/04/08


Tagged

Shell search unix find


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

johnloy
tazjel


Shell script to make lists of certain file types in a web site file system


 / Published in: Other
 

  1. mkdir file_lists
  2. find . -name '*.pdf' -o -name '*.PDF' > ./file_lists/all_pdf_files.txt
  3. find . -name '*.pdf' -o -name '*.PDF' -mtime +365 > ./file_lists/pdf_files_mtime_gt_1yr.txt
  4.  
  5. find . -name '*.jpg' -o -name '*.JPG' -o -name '*.gif' -o -name '*.GIF' -o -name '*.png' -o -name '*.PNG' > ./file_lists/all_image_files.txt
  6.  
  7. find . -name '*.log' -o -name '*.LOG' > ./file_lists/all_log_files.txt
  8.  
  9. find . -name '*.css' -o -name '*.CSS' -o -name '*.js' -o -name '*.JS' > ./file_lists/all_design_assets_files.txt
  10.  
  11. find . -name '*.ram' -o -name '*.RAM' -o -name '*.aif' -o -name '*.AIF' -o -name '*.mp3' -o -name '*.MP3' > ./file_lists/all_audio_files.txt
  12. find . -name '*.ram' -o -name '*.RAM' -o -name '*.aif' -o -name '*.AIF' -o -name '*.mp3' -o -name '*.MP3' -mtime +365 > ./file_lists/audio_files_mtime_gt_1yr.txt
  13.  
  14. find . -name '*.html' -o -name '*.HTML' -o -name '*.htm' -o -name '*.HTM' > ./file_lists/all_html_files.txt
  15. find . -name '*.html' -o -name '*.HTML' -o -name '*.htm' -o -name '*.HTM' -mtime +365 > ./file_lists/html_files_mtime_gt_1yr.txt

Report this snippet  

You need to login to post a comment.