LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-24-2004, 01:52 AM   #1
mahen
LQ Newbie
 
Registered: Sep 2004
Posts: 5

Rep: Reputation: 0
Help a new member


greetings everyone, i've just registered as a new member. I need your help. when i compile C files like this:

cc file.c -o file

it compiles successfully but when i try to execute it:

file

it says: "Command not Found"

i tried to modify the permission of the file but in vain, please help me
 
Old 09-24-2004, 01:57 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Three advices:

- look at the forum rules, please use a meaningful title
- search the forum, your question is a very common request
- if you're too lazy, the answer is:
./file
 
Old 09-24-2004, 02:00 AM   #3
rajesh_b
Member
 
Registered: Sep 2004
Location: Hyderabad.
Posts: 83

Rep: Reputation: 15
when you give a command it searches for the standard path. when u r trying to execute the file it will search in that path only. so you have to tell that file in the current directory must be executed. u can refer the current directory by ./ (dot followed by slash). so the command to execute the object file is

./file
 
Old 09-26-2004, 03:06 AM   #4
mahen
LQ Newbie
 
Registered: Sep 2004
Posts: 5

Original Poster
Rep: Reputation: 0
i don't know hoe to use "./file"

I'm sorry, but i am having problems understanding your solution, could you be more clear.
 
Old 09-26-2004, 03:26 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
mahen... you need to ***REPLY*** to threads, not start new ones when you're referring to them directly.

threads merged.

./ means your current directory. running that gcc command will output he file to the directory you run it from. this directory would not be on your path (despite you already being there) so you need to say exactly where it is.

Quote:
could you be more clear.
not sure how his solution could have been any clearer really...

jlliagre, thanks for being erm.. vigilent... but it's first post, go a little easier next time? cheers/
 
Old 09-26-2004, 07:35 AM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
jlliagre, thanks for being erm.. vigilent... but it's first post, go a little easier next time? cheers/
Yep, sorry mahen, I kind of over-reacted ...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
hello from a new member! jcorominas LinuxQuestions.org Member Intro 1 06-07-2005 12:30 PM
LQ member progress status from member to senior member............. emailssent LQ Suggestions & Feedback 3 10-11-2004 01:31 PM
New Member StarTekMobile LinuxQuestions.org Member Intro 1 07-23-2004 02:42 AM
yet another new member Bodo LinuxQuestions.org Member Intro 0 08-24-2003 11:21 AM
New Member /bin/false LinuxQuestions.org Member Intro 0 08-11-2003 09:28 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration