Skip to content

Instantly share code, notes, and snippets.

@smilingkylan
Created February 28, 2020 07:35
Show Gist options
  • Save smilingkylan/4d8f4157f1adc7752892a13210ccedff to your computer and use it in GitHub Desktop.
Save smilingkylan/4d8f4157f1adc7752892a13210ccedff to your computer and use it in GitHub Desktop.
Useful Filename Manipulation Bash Scripts
# Each note separates the command from all the others in this file
# You are only meant to use one command / clause at a time
# Add 'Saga' to each filename before the extension
for f in *; do mv "$f" "${f}Saga"; done
# Capitalize first letter of each filename in folder
for f in * ; do
mv -- "$f" "$(tr [:lower:] [:upper:] <<< "${f:0:1}")${f:1}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment