How do I enter a file or directory with special characters in its name?
That command is ambiguous because spaces are normally used to separate arguments. cd does not know what you want to do but you have two possibilities to solve it:
Either you "mask" the spaces (and all other special characters) so that the terminal knows you mean the space as a character and not as a separator:
cd Milano\,\ Torino\ \(Jan\)-Compressed
Or you put your folder name or path into quotes:
cd "Milano, Torino (Jan)-Compressed"
A little tip: tab completion ;-)
- Just type the first letter e.g
cd Mi
(or more letters if needed) and press Tab. Terminal will help you by completing the rest words.
Another way: drag and drop
- If you can see the directory and if you want to access it using terminal, just type:
cd
first and then drag and drop the directory on the terminal and hit enter.
Write it as:
cd 'Milano, Torino (Jan)-Compressed'
Otherwise it treats Milano,
as the folder name. This happens because of the spaces in the name of the folder. Alternatively escape a few of the special characters:
cd Milano\,\ Torino\ \(Jan\)-Compressed/