Skip to content

Instantly share code, notes, and snippets.

@bebyx
Last active July 12, 2020 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bebyx/dff2aa998485504a411a553e525b357e to your computer and use it in GitHub Desktop.
Save bebyx/dff2aa998485504a411a553e525b357e to your computer and use it in GitHub Desktop.
Simple shell script to remove screenshots from general Pictures folder to separate Pictures/Screenshots/ folder
#!/bin/sh
set -e
DIRECTORY="$HOME/Pictures/Screenshots/"
[ ! -d "$DIRECTORY" ] && mkdir $DIRECTORY
ls ${DIRECTORY%\s\/}*.png >/dev/null 2>&1 && mv ${DIRECTORY%s/}*.png $DIRECTORY && echo "Screenshots successfully moved in a separate folder" || echo "No new screenshots"
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment