How to Access directories with spaces on Linux

A common issue for Linux or Unix noobs is a way of accessing folder in Linux or UNIX with white spaces. Well why in the world am I writing about this? Because it is such an opportunity as no one I think has written a single article with the same title as I have on the World Wide Web which means a pure unique content that might attract users and search engines.

In this article I will teach you how to navigate between folders with spaces. This is applicable on creating a folder with space as well. When accessing a folder with space on Linux all you need to is just like the below:


ls


As you have noticed on the picture above I initially created a directory with space named “space dir” and if you are keen enough you should have noticed the backslash “\” after the word space. To make sure that it is a single directory I tried accessing space as shown on the picture and it made errors telling that the directory does not exists making us sure that it followed what we wanted.

Now what we want to do is access that directory we just created so look carefully how it’s made on the picture below:

ls2



To make sure that we are on the correct place I issued the command pwd to print the current directory where are at.

Tags: , , ,

Enter your email address:     

Related Entries you might want to read:
» Greenlantern Linux
» How to get the WLAN MAC Address of a Nokia Phone
» Affiliates
» The Best IT Certification for 2010
» Gmaik

Leave a Reply