Ubuntu – Desktop directory not opening

bashcommand linedirectory

I am completely new to Ubuntu or any distribution of linux altogether. While using the terminal, when i am in the /home/username directory the ls command shows Desktop and Download directories but the command cd /Desktop does not work. it says bash: cd: /Desktop: No such file or directory.

Another directory, which i made manually, opens up ok. it also does this with many other folders, what am i doing wrong here.

Best Answer

In UNIX systems the "/" is always the main folder (the start of the tree).

When you are in /home/username you have to write relative path to this directory in order to navigate deeper in the tree e.g. cd Desktop (without "/" in front of Desktop) or you can use the absolute path

cd /home/username/Desktop

but absolute paths are usually not a good way to move in the tree, because if you are somewhere in a deep place in the tree you don't want to write all the folders just to get one level deeper or go to at the upper level.

To move one level upper you have to write cd ../ which is again relative to the folder where you are at the moment.

Related Question