

helps avoiding issues with filenames that might start with - (which is a whole different bag of problems and is a topic for another day).Īlternatively, you can give full path: $ cd ~/Documents/xmr-stak-cpu-1.3.0-1.5.0/ However, it's better to be explicit, and besides. , when you simply do cd xmr-stak-cpu-1.3.0-1.5.0 will automatically look inside your current working directory. When you cd ~/Documents and want to navigate to folder that's located inside the current directory that you're at, you can use. You can do it in one of two ways - give full path or jump into ~/Documents first, then jump to directory you want.

Of course, because the directory you specified doesn't exist, you got the appropriate error message. The shell properly expanded ~ to be /home/chance and joined that with what you gave it. Look at the error message closely: bash: cd: **/home/chance/xmr-stak-cpu-1.3.0-1.5.0**: No such file or directory So if you want to descend from home, to Documents, to your folder, all pieces must be present in the path, separated by slashes, and the folder you want to end up in, of course, has to be the right most. What also is important to note, is that a path is always read left to right, separated by slashes, with the leftmost being the top of the directory tree that you reference. So when you do cd ~/xmr-stak-cpu-1.3.0-1.5.0, you're saying take me to xmr-stak-cpu-1.3.0-1.5.0 directory that is located in my home folder. (There are exceptions and special cases but for the purpose of explaining the basics, let's keep it simple so far see below for the deeper explanation). ~/Documents always means /home/chance/Documents. The leading ~ (tilde) followed by slash in path is understood as reference to your user's home directory, i.e. First two sections are more or less gentle explanations of what OP did and didn't do. The answer is edited to include more formal explanation of tilde expansion and to suit the new edited title of the question, so please read the more formal explanation below. ~ is relevant in command-line only, not in GUI (as mentioned in comments).navigating to a directory can be done via giving path relative to your current working directory, or specifying full path.means in this folder or stuff in current working directory


leading ~/ in path means your home folder.path is read left to right, with leftmost directory specified being the top of the directory tree you're traversing.
