What do these two commands mean?
I am ending up in two directories upwards the tree on the first command and in the root directory from the second command. Why does that happen?
Paths that don't start with a
Every directory has to special entries:
But what does it mean to talk about the directory that contains
This is why
The first is a relative path. The second is an absolute path.
The .. operator in that argument means move up one.
The slash when not at the front means division of sub-directory name.
The slash when at the front means "This is an absolute path. Start at root directory." The .. is discarded since you can't back out any further. (There was a time when lots of these allowed you to break chroots)
A single dot (.) represents the current directory. In fact, if you executed a
To return to the root directory, you can execute a
That puts me in the /dir1/dir2 directory, because (as we established above) the
By invoking a