Monday, April 29, 2024
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 146958  / 2 Years ago, sat, january 22, 2022, 5:06:25

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.


More From » command-line

 Answers
0

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.


[#40359] Saturday, January 22, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ligdesig

Total Points: 164
Total Questions: 106
Total Answers: 114

Location: Japan
Member since Sat, Jun 6, 2020
4 Years ago
;