Sunday, May 5, 2024
84
rated 0 times [  84] [ 0]  / answers: 1 / hits: 705750  / 3 Years ago, sat, august 21, 2021, 11:33:16

I can't figure out how to write the path of a folder that includes spaces in its name (in Terminal).



I tried:



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

cd /path/path/path/'A Folder/file

cd /path/path/path/A_Folder/file


but they all return the error through the terminal:



[command]: cannot access '/path/path/path/A Folder/file' No such a file or directory 


I can still access it through steps like so:



cd /home
cd user
cd Desktop
cd "Bash Programming"
bash Example

More From » command-line

 Answers
4

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

[#22992] Saturday, August 21, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ouschee

Total Points: 485
Total Questions: 88
Total Answers: 106

Location: Central African Republic
Member since Mon, Aug 10, 2020
4 Years ago
;