Change Directory Command to Desktop [Duplicate]

Change Directory Command to Desktop [Duplicate]

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?

1

3 Answers

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.

14

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.

Run this command in terminal,it will help you.

cd ~/Desktop
gcc yourfilename.c
1
Sarah Jenkins
Author

Sarah Jenkins

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.