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'm try to change to my Desktop directory from the terminal.

Running

cd /home/desktop

Gives an error in the terminal saying no directory found.

What am I doing wrong?

share|improve this question
add comment

4 Answers

iBelieve answers almost everything but alternatively you can type

cd ~/Desktop/

the ~/ stands for /home/$USER/

share|improve this answer
1  
+1 for mentioning the tilde-home shortcut. Although it stands for /home/<username>/. –  BryceAtNetwork23 Aug 20 '13 at 18:33
    
<username> disappeared so I changed it to [username] –  Arno van der Weijden Aug 21 '13 at 13:06
    
Home also needs to be lowercase, and you can use html escapes to get the < and > symbols to appear (I edited to demonstrate) –  Drake Clarris Aug 21 '13 at 13:13
    
You too: $USER is easier ;-) (it will automatically transform to the current user) –  Rinzwind Aug 21 '13 at 15:06
add comment

To answer your question mentioned in the quoted article:

The directory format is like this:

/
    home
        <username>
            Desktop
            Documents
            ...

so your command should be

cd /home/$USER/Desktop

To learn the directory structure, I'd suggest opening up the Home Folder app from the launcher on the left, and going to Computer and just exploring for a while. You won't be able to break anything outside of your home folder.

share|improve this answer
2  
$USER is easier ;-) (it will automatically transform to the current user) –  Rinzwind Aug 21 '13 at 15:05
add comment

Because I haven't seen it mentioned yet, it should be noted that all directory names in Ubuntu (Linux) are case-sensitive. So even if you were in your correct home directory, executing a cd desktop should and will fail. If you look at @iBelieve's post, you can see that the "Desktop" directory starts with a capital 'D'. To get there, you will need to specify the correct case.

cd Desktop

To help you in the future, take a look at this command line tutorial from the community: https://help.ubuntu.com/community/UsingTheTerminal

share|improve this answer
add comment

The following bash builtin commands are equivalent and they change the current working directory to your Desktop directory from your user home directory:

cd ~/Desktop               # my favorite

cd ~; cd Desktop

cd ~ && cd Desktop

cd $HOME/Desktop

cd /home/$USER/Desktop

cd /home/username/Desktop  # where 'username' is your user name

cd $CDPATH && cd Desktop

cd `locate -b '\Desktop'`

cd $(locate -b '\Desktop')
share|improve this answer
add comment

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.