Command line can't find file on Desktop.

Asked by cjones

When I try to compile a c file on the desktop by <gcc new.c> or <gcc -g new.c> the computer can't find the file even though I'm looking right at it on the desktop. The first line on the command line is chuckjones@chuckjones-desktop:~$. So it should be looking on the desktop.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Cesare Tirabassi
Solved:
Last query:
Last reply:
Revision history for this message
Best Cesare Tirabassi (norsetto) said :
#1

No, if the file is on the desktop than is inside the ~/Desktop directory. Therefore if you are in your $HOME directory (default when opening the terminal) you should use:

gcc Desktop/new.c

Revision history for this message
Cesare Tirabassi (norsetto) said :
#2

BTW, chuckjones-desktop is just the name you have given to your PC during installation.

Revision history for this message
cjones (cjones-designwesteng) said :
#3

Thank you.