LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices



Reply
 
Search this Thread
Old 03-22-2004, 09:33 AM   #1
legend1079
Member
 
Registered: Mar 2004
Location: Pakistan
Posts: 49

Rep: Reputation: 15
Question why ./ is used to run C++ compiled programs


hay everyone
i've asked the command to
run the c++ compiled program
i have told
$./<filename>
whats ./
and why used
 
Old 03-22-2004, 09:39 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,175

Rep: Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784
./ stands for current working directory. Unlike windows when you type in a command the shell only searches the path, it does not search the current directory.

To see your path:
echo $PATH
 
Old 03-22-2004, 09:45 AM   #3
legend1079
Member
 
Registered: Mar 2004
Location: Pakistan
Posts: 49

Original Poster
Rep: Reputation: 15
means taht if in windows
if i am in in some directory as
c:\tc\bin\>_
there if i write any command then return
that command execute if the command belongs to that directory
so in rh we need ./ key to tell consol to check the current dir
is it soo???
 
Old 03-23-2004, 06:24 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,175

Rep: Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784
./ is a shortcut for current directory.
 
Old 03-23-2004, 07:32 AM   #5
fsbooks
Member
 
Registered: Jan 2002
Location: Missoula. Montana, USA
Distribution: Slackware (various)
Posts: 449

Rep: Reputation: 31
Yes, it means current directory. the reason being: the current directory is often not in the $PATH, both for consistency (it keeps the same executables in the $PATH, nomatter what the current working directory $PWD), and for security (particularly where root is concerned).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
C compiler cannot run C compiled programs petero Programming 8 05-27-2005 12:35 PM
How to remove compiled programs? piggysmile Linux - Software 2 03-22-2005 06:25 AM
error: cannot run C compiled programs. terry.trent Linux - Newbie 6 08-06-2004 12:07 AM
"Can't run C compiled programs" on clean RH9 install smirnoff Linux - Newbie 8 03-16-2004 04:11 PM
cannot run C compiled programs Astro Slackware 7 01-27-2004 11:32 PM


All times are GMT -5. The time now is 03:56 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration