Command to rename all files in a directory in numerical sequence By editor on May 10, 2021 in Command to rename all files in a directory in numerical sequence. .ext can be changed to whichever extension you require. ls -v | cat -n | while read n f; do mv -n “$f” “$n.ext”; done Continue Reading