Skip to content

Instantly share code, notes, and snippets.

@cspenn
Last active July 15, 2016 11:45
Show Gist options
  • Save cspenn/8dab561f1f9ec941ee4fee49fe3154ac to your computer and use it in GitHub Desktop.
Save cspenn/8dab561f1f9ec941ee4fee49fe3154ac to your computer and use it in GitHub Desktop.
The Document Mover!
# Organize My Documents on a Mac
# Obviously make sure that the subfolders all exist first!
# Copyright © 2016 Christopher Penn
# Released under the GNU General Public License, 3.0
# Absolutely no support or warranty of any kind
DOCS=/path/to/documents # Normally /users/yourusername/documents on a Mac
PDF=/path/to/pdf/files
TEXT=/path/to/text/files
SLIDES=/path/to/presentations/files
SHEETS=/path/to/spreadsheets/files
IMAGES=/path/to/images/files
AUDIO=/path/to/audio/files
VIDEO=/path/to/video/files
CODE=/path/to/code/files
echo "Now moving PDF files\n"
mv -n *.pdf $PDF
mv -n *.PDF $PDF
echo "Now moving presentations\n"
mv -n *.key $SLIDES
mv -n *.ppt $SLIDES
mv -n *.pptx $SLIDES
mv -n *.KEY $SLIDES
mv -n *.PPT $SLIDES
mv -n *.PPTX $SLIDES
echo "Now moving text files\n"
mv -n *.txt $TEXT
mv -n *.doc $TEXT
mv -n *.DOC $TEXT
mv -n *.docx $TEXT
mv -n *.DOCX $TEXT
mv -n *.htm $TEXT
mv -n *.php $TEXT
mv -n *.sql $TEXT
mv -n *.html $TEXT
mv -n *.epub $TEXT
mv -n *.mobi $TEXT
mv -n *.pages $TEXT
mv -n *.scriv $TEXT
echo "Now moving CSV files\n"
mv -n *.csv $SHEETS
mv -n *.tsv $SHEETS
mv -n *.xls $SHEETS
mv -n *.xlsx $SHEETS
mv -n *.XLS $SHEETS
mv -n *.XLSX $SHEETS
mv -n *.twb $SHEETS
mv -n *.twbx $SHEETS
echo "Now moving image files\n"
mv -n *.jpg $IMAGES
mv -n *.jpeg $IMAGES
mv -n *.JPEG $IMAGES
mv -n *.JPG $IMAGES
mv -n *.gif $IMAGES
mv -n *.psd $IMAGES
mv -n *.png $IMAGES
mv -n *.PNG $IMAGES
mv -n *.ai $IMAGES
echo "Now moving audio files\n"
mv -n *.aif $AUDIO
mv -n *.aiff $AUDIO
mv -n *.mp3 $AUDIO
mv -n *.band $AUDIO
mv -n *.wav $AUDIO
mv -n *.m4a $AUDIO
echo "Now moving video files\n"
mv -n *.mp4 $VIDEO
mv -n *.MP4 $VIDEO
mv -n *.mkv $VIDEO
mv -n *.MKV $VIDEO
mv -n *.mpg $VIDEO
mv -n *.mov $VIDEO
mv -n *.MOV $VIDEO
mv -n *.flv $VIDEO
mv -n *.avi $VIDEO
mv -n *.AVI $VIDEO
mv -n *.wmv $VIDEO
mv -n *.m4v $VIDEO
mv -n *.M4V $VIDEO
mv -n *.cmproj $VIDEO
echo "Now moving code files\n"
mv -n *.json $CODE
mv -n *.css $CODE
mv -n *.php $CODE
mv -n *.py $CODE
mv -n *.xml $CODE
mv -n *.ruby $CODE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment