Created
July 5, 2019 10:37
-
-
Save imbdb/d33674b6f41780db7d8c6fb65d1b21b2 to your computer and use it in GitHub Desktop.
Revisions
-
imbdb created this gist
Jul 5, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ # Find all files with specified pattern using find and then mv them to new numbered name # eg. abc.jpeg, sdfs.jpeg,... --> 0001.jpeg,0002.jpeg,... find -iname '*.jpeg' | # find files gawk 'BEGIN{ a=1 }{ printf "mv \"%s\" \"%04d.jpeg\"\n", $0, a++ }' | # build mv command ( Change 04d(0000) to your number your files) bash