Organize screenshots by date
I take many screenshots using Mac OSX's handy shortcut cmd + shift + 4
. This will output a png, and save it to the Desktop.
I added the command below to my .bash_profile
file, and now when I type organize_screenshots
in the terminal, all the screenshot files in the desktop get organized in a screenshots folder that I have under my user directory (~/_screenshots).
Note: this command requires you have exiftool installed by Phil Harvey, an awesome tool to work with file metadata. (http://www.sno.phy.queensu.ca/~phil/exiftool/)
Add the following line to .bash_profile
:
alias organize_screenshots='(cd ~/_screenshots && exiftool -R "-Directory<FileModifyDate" -d %Y/%Y%m/%Y%m%d ~/Desktop)'
This is basically doing the following:
- Change directory to username/_screenshots folder
- Create a folder structure for screenshots based on when they were taken
- Move screenshot files from the Desktop to _screenshots folder
The screenshots folder organizes files using the following naming structure:
YYYY/YYYYMM/YYYYMMDD/Screen shot YYYY-MM-DD at HH.MM.png
Written by Luis Cielak
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#