Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexR1712/a29b39f70c153edb9507502743f83812 to your computer and use it in GitHub Desktop.
Save AlexR1712/a29b39f70c153edb9507502743f83812 to your computer and use it in GitHub Desktop.
Rename files based on the modified date, add incremental number to the begining of the filename.
ls -1rt | cat -n | while read n f; do mv -n "$f" "$n""_""$f"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment