Skip to content

Instantly share code, notes, and snippets.

@adamgibbons
Last active December 25, 2015 05:38
Show Gist options
  • Save adamgibbons/6925504 to your computer and use it in GitHub Desktop.
Save adamgibbons/6925504 to your computer and use it in GitHub Desktop.
For all files in a directory, replace x with y.
#!/bin/bash
ls | while read -r FILE
do
mv -v "$FILE" `echo $FILE | tr 'x' 'y' `
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment