Click to See Complete Forum and Search --> : ifconfig - command not found - but it's there!


mstembri3
02-25-2001, 07:33 PM
(new installation of redhat 7.0)

I'm logged in as root. ifconfig is in the sbin directory. When I type:

ifconfig

It tells me bash: ifconfig: command not found.

I've heard great things about linux, but this does nothing to win my confidence. This is the kind of thing I expect from using windows.

What needs to be done to correct this problem? Reinstall redhat?

mstembri3
02-25-2001, 07:35 PM
Check that. No programs are running. I'm in the sbin directory -- nothing I run is recognized, even though I can pull it up in a ls. :mad:

Gnu/Vince
02-25-2001, 07:35 PM
cd /sbin ; ls ifconfig

if it's there, then tell us.

Gnu/Vince
02-25-2001, 07:36 PM
try /sbin/ifconfig. If that works, then /sbin is not in your PATH

mstembri3
02-25-2001, 07:41 PM
echo $PATH - /sbin not included. typing /sbin/ifconfig works. Off to learn how to add a path to $PATH

Gnu/Vince
02-25-2001, 07:44 PM
edit /etc/profile

mstembri3
02-25-2001, 08:00 PM
bash: edit: command not found.

There are a gazillion references to edit when i use locate edit. Will any text editor do?

mstembri3
02-25-2001, 08:05 PM
PATH = "$PATH:/usr/X11R6/bin"

In the NHF, the example doesn't have "" around the path. Are they necessary?

bugfix
02-25-2001, 08:08 PM
'edit' is not a text editor. There's two commonly used editors in Linux; emacs and vi, both have their supporters but neither you can pick up and start using straight away. There's NHF's on this site to help you out.

(BTW. I use 'vi'.)

mstembri3
02-25-2001, 08:17 PM
Hm.. then what is 'edit' in relation to profile? I used vi to look at profile, that is where I got the info two posts above.

I'm looking at the NHF on bash. It has a lot of info, but doesn't specifically address what to do to add another path to $PATH. (if it does, it's not obvious {like a newbie help file should be, right :) })

Gnu/Vince
02-25-2001, 08:18 PM
When I said edit, I said start your favourite text editor (vi, vim, jed, emacs, joe, pico, nano, gedit, xedit, etc.)

Use xedit if you're REALY new. Then go learn emacs or vi(m) (I suggest you learn vi)

Tyr-7BE
02-25-2001, 08:49 PM
Booya. Log in as root. Then:

vi /root/.bashrc
There should be a PATH=<something> line. Make sure /sbin is included. Here's my line: PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
Make sure that /sbin is included, as well as /bin. If you're using Red Hat, it's probably a good idea to make it look like mine, as I'm using Mandrake and Mandrake is the spitting image of Red Hat.
TO DO THE EDITING IN VI:

To edit the text: press either "a" or "i".
To get out of text editing mode: press Esc.
To exit saving changes: Hold shift, and press "Z" twice.

Those are the basics of vi. I recommend learning more, as a lot of fun in linux is using things like vi :) Hope this helps...tell me whether it does or not. Another thing...hang in there. Everyone has problems to start out with.

mstembri3
02-25-2001, 09:03 PM
Mucho thanks Tyr7BE (and the rest), that did it.