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 |
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
|
Quote:
Quote:
|
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. |
All times are GMT -5. The time now is 03:01 PM. |