Removing all spaces in a file name

Why would you want to remove spaces in a file name?  Because IT’S ANNOYING!

When running scripts or traversing through directories, spaces make life just that little bit more annoying.  Sure not A LOT more annoying, but a little.  I’m a fan of being as least annoyed as I possibly can be, so here’s a command that will remove spaces of all files in a directory and replace them with an underscore.

rename 's/ /_/g' *

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *