Skip to content

Instantly share code, notes, and snippets.

@j0hj0h
Created November 7, 2019 15:40
Show Gist options
  • Save j0hj0h/eafd4442d212f619b1bd2770b600f0d0 to your computer and use it in GitHub Desktop.
Save j0hj0h/eafd4442d212f619b1bd2770b600f0d0 to your computer and use it in GitHub Desktop.
Write file modification time to filename
for file in *.csv; do
new_name=$(date -r $file "+%Y%m%d-%H%M%S").csv
echo "renaming $file to $new_name"
mv $file $new_name
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment