Sunday, November 16, 2014

Remove Underscores from Filenames

Here is a quick and dirty (very dirty) way to remove underscores from filenames:

  1. Open a terminal (like Cygwin).
  2. Change the directory to the one with the files that you want to change.
  3. Run: rename '_' ' ' *; ls
  4. You may need to run the command several times until there are no more underscores left in the filenames.
There is probably a better way to do this using a sed or awk command, but I didn't have time to look it up.