LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   problem with ifconfig and vi file (https://www.linuxquestions.org/questions/linux-newbie-8/problem-with-ifconfig-and-vi-file-510273/)

boy_to_man 12-14-2006 12:45 AM

problem with ifconfig and vi file
 
Hi
i know that if we want to know about ip address of pc in linux OS we must type ifconfig, right?
But i cant type it in my PC. I dont know why. help me pls
i type as this but nothing happen it display a error :command not found
[root@user ~]#ifconfig

another question is:
what must i do to save a vi file
as # vi smb.config
i have change something inside but dont know how to save it:confused: :confused:

thank a lot

icechong 12-14-2006 12:58 AM

1. make sure your "ifconfig" is in your /sbin.

2. to save file on vi, after finish typing, press "esc" then ":wq" follow by enter.

boy_to_man 12-14-2006 01:07 AM

Quote:

Originally Posted by icechong
1. make sure your "ifconfig" is in your /sbin.

Thanks for ur reply

i have success with vi file but with ifconfig is not yet

might be ur meant was
[root@user ~]#cd sbin
[root@user sbin]#ifconfig
Right?
But it still is command not found

thanks

Nathanael 12-14-2006 01:14 AM

Quote:

[root@user ~]
you are in root's home directory not /
you can by the tilde ~
normally this is /root
so a cd sbin will not get you to /sbin but rather to /root/sbin if it exists. otherwise will result in an error.
cd /sbin will get you to where you want to go.
then typing ./ifconfig rather than ifconfig will execute the ifconfig file in /sbin
you could also just type /sbin/ifconfig
that would also execute ifconfig in /sbin

if that works root's $PATH is incorrect
to check type
echo $PATH

boy_to_man 12-14-2006 01:41 AM

@Nathanael :Thanks so much
I have success with /sbin/ifconfig command
but fail wih ./ifconfig
I am using fedora 6.0

Thanks again

icechong 12-14-2006 11:57 PM

try

echo $PATH

what do you get?


All times are GMT -5. The time now is 05:07 PM.