LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 08: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, 08:39 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,592

Rep: Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880
./ 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, 08: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, 05:24 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,592

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

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

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 02:36 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
Open Source Consulting | Domain Registration