Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

when I open up the terminal and write the command

cd Desktop  

also I have tried

cd /Desktop

a message appears that no file or directory was found what I suppose to do? I have logged in as a root but still have the same problem any help?

share|improve this question
about cd command… – Afshin Hamedi Sep 8 '14 at 14:54
up vote 2 down vote accepted

To enter your user's Desktop directory, run cd ~/Desktop (the ~ is expanded into your user's home directory). If your Desktop directory doesn't exist, you can create it via mkdir ~/Desktop.

share|improve this answer
but I want to run a specific c document exist on my Ubuntu desktop if I make a new directory it will be empty – arze ramade Nov 8 '13 at 14:46
@arzeramade then you can drag the document into the terminal and then remove the "file://" at the beginning. – Ramchandra Apte Nov 8 '13 at 14:48
sorry but I am new to UNIX can you tell me exactly how to do this ? – arze ramade Nov 8 '13 at 14:49
@arzeramade What part you don't understand? – Ramchandra Apte Nov 8 '13 at 14:50
how to drag the document to terminal – arze ramade Nov 8 '13 at 14:51

cd Desktop/ Goes to the Desktop directory if you are in your home directory.

cd - Goes back to previous directory.

cd / Take you to the root directory.

cd ~/Desktop Will take you to your Desktop Directory no matter where you are.

share|improve this answer

Run this command in terminal,it will help you.

cd ~/Desktop
gcc yourfilename.c
share|improve this answer
Why sudo to compile? One link at random:… – Rmano Nov 8 '13 at 16:13

Your Answer


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.