LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ifconfig won't work (https://www.linuxquestions.org/questions/linux-newbie-8/ifconfig-wont-work-55453/)

Hollywood W 04-17-2003 02:22 AM

ifconfig won't work
 
I go into my /sbin directory and can't seem to run ifconfig. it is found in the directory but it won't start up. I'm currently running RH 8. Feedback would be greatly appreciated.

jharris 04-17-2003 02:35 AM

Tell us exactly what you are typing and what you're trying to accomplish.

cheers

Jamie...

Hollywood W 04-17-2003 02:59 AM

I type "ifconfig -a"
I am trying to accomplish a preview of my IP Address.

jharris 04-17-2003 03:02 AM

Give this a try instead
Code:

cd /sbin
./ifconfig

It just looks like ifconfig isn't in your path. You are logged in as root yeah?

cheers

Jamie...

Hollywood W 04-17-2003 03:24 AM

hey that seemed to work and I wasn't logged in as root, how do I get it to work no matter what directory I'm in?

jharris 04-17-2003 03:29 AM

/sbin isn't in the path of non-root users as most of those commands need yout to be root to do anything useful with. You can add it to your path (and everyone's path on the machines) by editing the PATH statement in /etc/profile. Alternatively if you just want to edit your user's path you can create a .profile/.bash_profile/.bashrc/.cshrc/whateverFileYourShellUses in your home directory and put a new PATH statement in there.

cheers

Jamie...

Hollywood W 04-17-2003 03:49 AM

Ok I set the PATH variable in the .profile of my user account. Do I need to log out and log in again to invoke the new .profile settings in order for this new PATH to work?

jharris 04-17-2003 03:51 AM

You either need to logout and log back in, start a new shell, or run
Code:

source ~/.profile
You'll need to run the source command in every shell you have open if you choose to not logout/in.

cheers

Jamie...

Hollywood W 04-17-2003 04:02 AM

Thanks alot for your help. Can I use the .profile as a startup on applications as well?

jharris 04-17-2003 04:07 AM

I don't follow... The .profile file is typically used to define environment variables and carry out tasks at startup, you could start applications from it but you would end up starting those applications evertime you opened a shell.

Is that the answer to the question you asked or did I just answer the question I thought you were asking?

cheers

Jamie...


All times are GMT -5. The time now is 01:38 AM.