cd / doesn't move to previous directory, but to the filesystem root (e.g. where the folders etc, home and var are located).
To move to the previous directory, you can use:
cd -
And the home directory doesn't necessary have to be the "first directory" (a session can start outside of the users home directory). cd ~ always changes directory the current users home (which can, but doesn't have to be the "first directory" after login).
Also quite helpful:
To go up one level (e.g. move out of the current folder), you can use: cd .. - .. means "the directory above the current one".
Still a great overview over the most basic CLI commands on Linux-based operating systems, thank you!
A little correction:
cd /
doesn't move to previous directory, but to the filesystem root (e.g. where the foldersetc
,home
andvar
are located).To move to the previous directory, you can use:
And the home directory doesn't necessary have to be the "first directory" (a session can start outside of the users home directory).
cd ~
always changes directory the current users home (which can, but doesn't have to be the "first directory" after login).Also quite helpful:
To go up one level (e.g. move out of the current folder), you can use:
cd ..
-..
means "the directory above the current one".Still a great overview over the most basic CLI commands on Linux-based operating systems, thank you!
I appreciate for the correction, thank you