Posted By

austinhappel on 11/05/10


Tagged

Bash script osx desktop organization


Versions (?)

Desktop Supersort


 / Published in: Bash
 

URL: http://punchcut.com/perspectives/posts/better-living-through-shell-scripting

  1. #!/bin/sh
  2.  
  3. # Assign variables
  4. foldername=desktop`date +%Y%m%d`
  5. src=~/Desktop
  6. stor=~/Storage/$foldername
  7.  
  8. # Create folders within Storage
  9. # Add folder names here as desired
  10. mkdir $stor
  11. mkdir $stor/Design
  12. mkdir $stor/Images
  13. mkdir $stor/Misc
  14.  
  15. # Switch directory to Desktop to start
  16. cd $src
  17.  
  18. # Move files to Storage, sorted into folders
  19. mv *.{psd,eps,ai,indd} $stor/Design
  20. mv *.{png,gif,jpg,jpeg,tif,tiff} $stor/Images
  21. mv * $stor/Misc

Report this snippet  

You need to login to post a comment.