Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

up vote 4 down vote accepted

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.

share|improve this answer

If you type /Desktop with the / before the word Desktop, for linux it means you want to go to the root directory which is / and then go to the Desktop folder. That means that the Desktop folder would not be in /home/username/Desktop but in /Desktop which would be the error here.

In your case and everybody else, the Desktop folder is normally in the /home/username/Desktop.

So if you open the terminal and you are already in your user directory, for example /home/username then you only need to just type cd Desktop because you are already in the directory where desktop is.

If you were in for example /var/www and you want to go to your desktop you would type one of the following:

  1. cd ~/Desktop which is the same as typing /home/username/Desktop because the ~ will by default point you to the directory of your username. Think of it like ~ is equal to /home/username.
  2. cd /home/username/Desktop
  3. Or doing it by steps: cd /home, cd username, cd Desktop.. at last!

to know in what directory you are in type pwd (Print Working Directory). Also remember that everything is case sensitive. Desktop is not the same as desktop or DeskTOP

Here are some images of what it looks like to me when I open the terminal and go to Desktop. The first image says Desktop/ because I typed "des" and then pressed TAB (which autocompletes the word and adds the trailing / symbol. The second one I typed Desktop:

enter image description here

enter image description here

Now the next 2 images are if you start from another place. In this case we are in /var/www/:

enter image description here

enter image description here

share|improve this answer

Try using:

cd /home/YOUR-USER-NAME-HERE/Desktop

A shortcut for /home/YOUR-USER-NAME-HERE/ is ~/, so the following should also work:

cd ~/Desktop
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.