Skip to content

Instantly share code, notes, and snippets.

@uilian uilian/
Created Apr 15, 2019

What would you like to do?
Multi-rename files
# Assembles the old and new names, in the following example the name has 3 parts
# The NR adds a linenumber to the new name.
s ls pattern_file_name* | awk '{print "mv " $1"\\ "$2"\\ "$3" " $1 NR $3 }' | bash $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.