Created
November 25, 2019 09:48
-
-
Save JoseHdez2/f10d78a18121fe5c105e9f01d72321ee to your computer and use it in GitHub Desktop.
Sort files in current directory into folders by date (YYYY-MM-DD)
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/bash | |
for x in *.*; do | |
d=$(date -r "$x" +%Y-%m-%d) | |
mkdir -p "$d" | |
mv -- "$x" "$d/" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment