LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-06-2005, 09:37 AM   #1
sharvey44
LQ Newbie
 
Registered: Apr 2005
Posts: 1

Rep: Reputation: 0
I have a stoopid noob question!!


What's the difference between running a program with the prefix ./

I.e.

$ ./program <arguement>

$ program <arguement>

I know its stupid one but i cant find the answer anywhere!!

Cheers
 
Old 04-06-2005, 09:39 AM   #2
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,272

Rep: Reputation: 154Reputation: 154
the ./ represents your working directory. As a normal user you normally have ./ in your path so don't need to bother with it, but when your root you don't, so you need the ./ to execute a script or program in the current directory
 
Old 04-06-2005, 09:41 AM   #3
merchtemeagle
Member
 
Registered: Oct 2004
Location: Belgium
Distribution: Slackware 13.37
Posts: 512

Rep: Reputation: 31
Quote:
$ ./program <arguement>
This searches the current directory.

Quote:
$ program <arguement
This searches the $PATH.
 
Old 04-06-2005, 11:13 AM   #4
rose_bud4201
Member
 
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 929

Rep: Reputation: 30
Continuing on what merchtemeagle said, $PATH contains a colon-separated list of all the directories linux by default looks in when you type the name of an executable.

You can find out if "." (i.e. whatever directory you're currently in) is in your $PATH by doing

echo $PATH

Example:
[lthurber@hostname ~]$ echo $PATH
/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:.:/opt/IBM/director/bin:/opt/gnome/bin:/sbin:/home/lthurber/java/bin:/usr/local/ant/bin:/home/lthurber/projects/citicom/build/dev:/usr/java/bin:/usr/local/ant/bin:/home/db2inst1/sqllib/bin:/home/db2inst1/sqllib/adm:/home/db2inst1/sqllib/misc

If you look closely you can see that I do in fact have . in my path - right there between /opt/kde3/bin and /opt/IBM/director/bin

If it is there (as it usually will be, for a regular user) you won't have to type the ./ to run a program in your current directory.
 
  


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
noob with a noob question phoonerorlater Linux - Newbie 2 09-29-2004 03:43 PM
stoopid noob here voodooutt Linux - Newbie 9 11-15-2003 10:38 PM
Complete noob question from a noob noob_hampster Linux - Software 2 09-04-2003 12:03 AM
I feel stoopid butface Linux - Newbie 6 07-24-2003 09:48 PM
VMware and a really stoopid question esteeven Linux - Software 6 09-04-2002 03:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:06 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