Last active
July 6, 2022 08:11
-
-
Save m-cakir/0980338e9257a74234a6ce80e7801340 to your computer and use it in GitHub Desktop.
move files to sub directories sorting/grouping by created date - unix
This file contains hidden or 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
$ chunk_size=5;n=0; for f in `ls *.json --full-time -t -r | gawk '{print $9}'`; do d="sub$((n++ / chunk_size))"; mkdir -p "$d"; mv -- "$f" "$d/$f"; done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how to sort/group files by time created
how can i move files into subdirectories by count