Print Logo

Rename All Filenames With Spaces to Underline

<<  <   >  >>

If you want to just rename a space to an underline in all filenames in a directory, try:

for fname in *; do mv "$fname" `echo $fname | tr ' ' '_'`; done

This article comes from NetAdminTools:

The URL for this story is:

Copyright 1997-2012 Read our Terms of Use.