Desktop Supersort


/ Published in: Bash
Save to your folder(s)



Copy this code and paste it in your HTML
  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

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.