How to write the path of a folder with space in its name?

You can enclose the whole path by double-quotes ("), single-quote (') or escape the space character using a backslash (\) :

cd "/path/path/path/A Folder/file"
cd '/path/path/path/A Folder/file'
cd /path/path/path/A\ Folder/file

Either quote the entire name:

cd "/path/path/path/A Folder/file"

or escape just the strange characters (space, in this case) using a backslash.

cd /path/path/path/A\ Folder/file

Another thing to try, is using tab completion:

cd /home/user/Desktop/Bas

Then press the TAB key, this should complete it to:

cd /home/user/Desktop/Bash\ Programming/

Then you can type the rest of the path.


Have you tried this?

cd Bash\ Programming

Or

/path/path/path/A\ Folder/file