I tried cd "~/Library/Application Support/"
-bash: cd: ~/Library/Application Support/: No such file or directory
also cd ~/Library/Application Support/
-bash: cd: ~/Library/Application Support/: No such file or directory
|
I tried also |
||||
|
|
|
You can use the If there is a space between words and you don't want to use the methods above, put a \ backslash before the space. eg Hope this helps |
|||||||||||||||
|
|
The core issue here is how the shell (bash) does quoting and how that affects tilde expansion and splitting into “words” (arguments for the program being run). bash only treats the leading tilde specially if it is not quoted. In addition, the following slash must also not be quoted. At the same time, bash parses command lines into “words” based on non-quoted whitespace. The In your particular situation, you need to leave the tilde and the following slash unquoted while quoting the space in the directory name. Your The most common solution is to use single-character escaping to quote just the space:
You can also use single or double quotes around either just the space or the space and some other bits of that argument (but not the
These kinds of quotes have different meanings, but they are identical in these examples. Single quotes protect literal strings while double quotes allow various expansions and substitutions in the quoted region. Often, you can just let the shell do the work for you.
|
|||||||||||
|
|
You need to escape the space in " Try |
|||
|
|
|
You can alternatively just drag a folder to the Terminal window too, the complete file/folder path will be paste at the cursor position. |
|||
|
|
|
When you double-quote a path, you're stopping the tilde expansion. So there are a few ways to do this:
The tilde is not quoted here, so tilde expansion will still be run.
You can expand environment variables inside double-quoted strings; this is basically what the tilde expansion is doing
You can also escape special characters (such as space) with a backslash. |
||||
|
|