Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ls -v sprites*.jpg | cat -n | while read n f; do mv -n "$f" "pc-$(($n-1)).jpg"; done
- # ls -v : Natural sort
- # cat -n : Appending line number before each line (Starts from 1)
- # mv -n : Do not overwrite
- # $(($n - 1)) : String to Int then arithmetics
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement