How Can We Help?

Command to rename all files in a directory in numerical sequence

You are here:
< All Topics

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

Table of Contents