Get rid of spaces in file/directory names.

If you want to get rid of the spaces in the file/directory names then just look at this simple script:

#!/bin/bash

ls | grep "\ " | while read item
do
  new=`echo ${item} | tr [:blank:] _`
  old=${item}
  mv "${old}" ${new}
done

Above mentioned script works in the current directory for files and directories.