Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-06-2005, 10:37 AM   #1
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 ./


$ ./program <arguement>

$ program <arguement>

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

Old 04-06-2005, 10:39 AM   #2
Senior Member
Registered: Oct 2004
Posts: 1,272

Rep: Reputation: 153Reputation: 153
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, 10:41 AM   #3
Registered: Oct 2004
Location: Belgium
Distribution: Slackware 13.37
Posts: 512

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

$ program <arguement
This searches the $PATH.
Old 04-06-2005, 12:13 PM   #4
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

[lthurber@hostname ~]$ echo $PATH

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.


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

All times are GMT -5. The time now is 05:45 PM.

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