[NTLUG:Discuss] Basic terminal question

Steve Baker sjbaker1 at airmail.net
Mon Mar 7 12:48:40 CST 2005


Bradley's List Address wrote:
> 
>>On Mon, 2005-03-07 at 23:06, Bradley's List Address wrote:
>>
>>>When using the terminal in my Fedora 2 machines, "ifconfig" is not
>>>recoginized, but works in a SUSE 9.2 terminal.
>>
>>What is your path?  Try /sbin/ifconfig
>>
>>If you are a regular user, it's probably not in your default path.
>>
>>
>>>The command "shutdown" works in Fedora , but is not recognized in SUSE.
>>
>>Same issue, more than likely.
>>
>>
>>>I feel like I am missing something very fundamental here.
>>>Can you tell me why this happens?
>>>
>>>Thanks,
>>>Bradley
>>
>>RW
>>
> 
> That was it. Thank you.
> I figured if I was in the directory sbin and typed ifconfig it would work.
> I was wrong.
> I will try to learn more about the path concept.

You can set up your 'PATH' to include '.' (the current directory) so the
shell will execute any program if it's in the current directory - but that
is generally frowned upon because you can get yourself in trouble by
inadvertantly naming a regular file after a common command!

However, you can always run a program from the current directory by putting
'./' in front of it.

Hence:

   $ cd /sbin
   $ ./ifconfig

...should work no matter *what* your path is set up to be.  But of course,
if you know where the program is, you can give it's full path name and skip
the 'cd' step:

   $ /sbin/ifconfig

---------------------------- Steve Baker -------------------------
HomeEmail: <sjbaker1 at airmail.net>    WorkEmail: <sjbaker at link.com>
HomePage : http://www.sjbaker.org
Projects : http://plib.sf.net    http://tuxaqfh.sf.net
            http://tuxkart.sf.net http://prettypoly.sf.net
-----BEGIN GEEK CODE BLOCK-----
GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M-
V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++
-----END GEEK CODE BLOCK-----




More information about the Discuss mailing list