Click to See Complete Forum and Search --> : IFCONFIG not found


klnyc
03-28-2004, 05:41 PM
Hi,

What the heck happened over here? I just installed freshly RH9 and im trying get my ip's out from the terminal. I login as SU and entered my pwd. When I enter "ifconfig eth0" I get Command Not Found. I see this command on LSMOD,but it just dont wont excute it.
Any help welcome.

klnyc
03-28-2004, 05:57 PM
Opps I fogot, I can get into the Internet w/o any problem. I can do anything, but I can't see my IP :(

DrChuck
03-28-2004, 06:04 PM
First try /sbin/ifconfig eth0 and see if you get a response.

I'm running RH9, and I see that ifconfig is part of the net-tools package. Is that one installed? Perhaps you unselected the networking packages during the install.

Hope this helps,

klnyc
03-28-2004, 06:24 PM
Wheres the Nettools? Its this under System Tools?
Man, I having touch these Linux thing for nearly 2 years and now im totaly noobie.
Let me look harder,brb.

DrChuck
03-28-2004, 06:34 PM
in a terminal window, try:
$ rpm -qa net-tools

Hayl
03-28-2004, 06:42 PM
/sbin/ifconfig

red hat sets stupid paths that exclude tools.

or try 'su -' instead of 'su'

klnyc
03-28-2004, 06:47 PM
OMG !!, Red Hat is stupid. You are right Hay1. I do need "su -" damn, who would in the right mind know this(esp noobies)
what are the difference "su-" and "su"?
Whoohoo thanks guys, ok let me tackle RealVNC now.

bwkaz
03-28-2004, 10:01 PM
"su -" starts a login shell (the same type of shell that either logging in from ctrl-alt-f2, or using Eterm, starts). Just plain "su" starts a non-login (but interactive) shell.

Login shells read /etc/profile first, then look for ~/.bash_profile, ~/.bash_login, or ~/.profile (they check in order, and only run the first one that's found) to pull in settings. Anything that gets set up in these files will be used by login shells.

Interactive shells read /etc/bashrc and then ~/.bashrc to pull in settings. Anything that gets set up in these files will be used by interactive shells.

IIRC, non-login non-interactive shells (like the ones started for cron jobs) don't read any startup files. But I'm not positive on that one -- to know for sure, you can look at man bash and search for INVOCATION (the forward slash character begins a search in most distros' pager, less, so you can hit forward slash and then type in INVOCATION and hit enter to search for it in the manpage).

Anyway, you can use either /sbin/ifconfig (give it the full path), which I personally prefer since even normal users can do that (they just don't get all the info that root gets), or you can start a login shell using "su -".

klnyc
03-28-2004, 10:11 PM
Thank you very much guys.

j79zlr
03-28-2004, 11:44 PM
use

echo $path

to see the current paths, su -, as stated, acts as a login shell and executes the login script which usually adds more paths. I use the csh and alias su to su -. :)

mdwatts
03-29-2004, 01:05 PM
Originally posted by klnyc

what are the difference "su-" and "su"?


The su manpage (man su) also explains the same as what bwkaz posted.

klnyc
03-29-2004, 06:55 PM
Thank you very much. I think Mandrake works with SU rather then "su -". Anyway, if one doesnt work i can use the other.