Programming in C(Help)

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
Mr Robot
Level 1
Level 1
Posts: 20
Joined: Sat Nov 25, 2017 12:05 pm

Programming in C(Help)

Post by Mr Robot » Mon Dec 11, 2017 5:45 am

Im trying to create a programm in C and i think i have downloaded everything..
so i create in gedit a programm and save it in desktop by the name first.c for example
After i go to terminal and give the command: cd Desktop it says no file with that name..
what is the command to "go" in desktop?

User avatar
Level 24
Level 24
Posts: 23378
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Programming in C(Help)

Post by xenopeek » Mon Dec 11, 2017 7:18 am

Depends on where you are. If you opened the terminal on the Desktop, you're already there. At any time (if the current path given in the prompt on the terminal is not clear to you) you can type pwd to get the full path of your current directory. To go to the Desktop, on English systems (on non-English systems the "Desktop" directory will have another name, something in your system language), from any other directory you can use cd ~/Desktop where ~ is shorthand for your home directory. Mind that Linux is case sensitive (you have to type upper and lower case letters correctly). You can use tab key on the terminal to autocomplete partially typed names.

Level 2
Level 2
Posts: 70
Joined: Mon Sep 05, 2016 9:00 am

Re: Programming in C(Help)

Post by richlion2 » Mon Dec 11, 2017 11:13 am

You can also locate your file:

(now you should be in your $HOME directory)

Code: Select all

find . -name first.c
# Or
find . -name first.c -exec ls -l {} \;
This will show you exactly where your file is.

Post Reply

Return to “Newbie Questions”