Jump to content

Using Ubuntu

- - - - -

  • Please log in to reply
4 replies to this topic

#1
AntLaTech

AntLaTech

    Learning Programmer

  • Members
  • PipPipPip
  • 30 posts
Hello Everyone, this is my first time using ubuntu with C. I wrote some code in a text editor on here and was trying run in the terminal but keep getting a error saying the directory invalid. Can someone guide me in the right direction so I can get this problem solved. Please reply if can help me.

Thanks,
Ant


#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
You may want to type the command ls to list all files in the current directory to verify it is there. What are you using to edit your files, or compile them, can you list sample commands you use to edit your file in command line?
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
espdev-darkness

espdev-darkness

    Learning Programmer

  • Members
  • PipPipPip
  • 44 posts
It's been a while since I used linux, but here's what I think. Your most likely not in the directory that contains your source files, if I am not mistaken Ubuntu allows you to right click in the current directory and select Open Terminal. This will open the Terminal in the directory that you are currently in which can be very usefull. It would be nice if you told us which compiler you are using, I would suggest gcc. You can find most any Ubuntu questions/answers on the array of Ubuntu forums and insall guides are plentiful.

#4
fread

fread

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 787 posts

Nullw0rm said:

You may want to type the command ls to list all files in the current directory to verify it is there. What are you using to edit your files, or compile them, can you list sample commands you use to edit your file in command line?

In addition you can use the 'cd' "PathToYourSourceFile" command to move to the directory containing the source files. Example:
If your source files are on the desktop you would need to figure out where you are in the shell (command line prompt). You can do so by typing "pwd". Lets say the result is /home/AntlaTech and your source files are on your desktop. You would move the focus of the shell to the desktop via
cd Desktop then verify the files are there with ls. Once the files are there you should be able to execute via the command line.
Perfection of means and confusion of ends seem to characterize our age. Albert Einstein :confused:

#5
mnirahd

mnirahd

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 330 posts
Hi,

Can you please explain us the steps you followed to compile and running your program?

Munir




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users