Skip to content

Instantly share code, notes, and snippets.

@bhishanpdl
Created November 14, 2018 16:06
Show Gist options
  • Save bhishanpdl/f19e9a263bea3c4758befb4648c7c767 to your computer and use it in GitHub Desktop.
Save bhishanpdl/f19e9a263bea3c4758befb4648c7c767 to your computer and use it in GitHub Desktop.
Rename files sequentially in bash
# rename files sequentially
num=0; for i in *; do mv "$i" "$(printf 'hello_%04d' $num).${i#*.}"; ((num++)); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment