Monday, 10 May 2010

Making Space

If, like me, you've got directories, files or drives with embedded spaces (whitespace) in their name (for instance, External Hdd) you may experience problems trying to reach them using the command line, try putting the name in quotes, thus:

cd /media/"External Hdd"

or (to display a text file with whitespaces in the terminal)

less /home/usr/"Word Space File.txt"

Or, if that doesn't work, a backspace might do the trick:

cd /media/External\Hdd

The double quote method works for me, both with directories and files: however, the lesson learned is that, if you intend to use the command line, try to avoid embedded spaces in Directory and file names. For instance, a better name for the drive in this case might be: External_Hdd (note the underscore!)

No comments:

Post a Comment