Created
January 13, 2024 22:25
-
-
Save organom/e097f8f245293c41da4b3eecf5edcd0a to your computer and use it in GitHub Desktop.
Renames files in folder (argument) to a sequantial name (ex: 01.mkv). Improve printf in case more than 100 files are required
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 | |
cd $1 | |
ls | cat -n | while read n f; do ext=${f##*.}; mv "$f" `printf "%02d.$ext" $n`; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment