-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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