Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
(Sorry if my RE is a little vague, unsure how else to word this!)
So I've finally settled on CentOS. Stable (AFAIK), looks good, and easy enough, yet not too easy enough. Make sense? Heh...
Well, up until a couple of days ago, ifconfig stopped working for me. Rather.... That command alone gives me the bash: ifconfig: command not found response. However... When I enter in /sbin/ifconfig command, it works fine.
Now, thanks to my friend Google, I know that ifconfig resides in that directory. I know that I can run with the /sbin/ in front of the command, and I can go on my merry way, and live the rest of my life underneath my umbrella of content. But lets be honest. I want it back! Heh
So I'm not sure what else I can give you so that you can just say, "Oh do this, that, and bodaboombadabing, you are back in business!". And all I can speculate, is that something happened to the 'link?' or whatever got debunked. So.... Ok. I'm ranting now. TIA!!!!
Any way you are loging through non-root user. /sbin dir not listed in non-root user's PATH.
only root or privileged users can run commands of /sbin /usr/sbin and /usr/local/sbin
run below command to verify your path
Code:
for non-root user
$ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/u1/bin
root user
# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
Last edited by sem007; 08-18-2010 at 09:48 AM.
Reason: provide more detail
[root@localhost /]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/shaun/bin
[root@localhost /]# ifconfig
bash: ifconfig: command not found
Sorry. Thought I was root. Still learning... ;]~ But as so far... I cannot wait to get my new lappy, and straight out of the door, running CentOS, instead of bowing down to WIN7!!! LoL! TIA everyone! =]
[root@localhost /]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/shaun/bin
[root@localhost /]# ifconfig
bash: ifconfig: command not found
Sorry. Thought I was root. Still learning... ;]~ But as so far... I cannot wait to get my new lappy, and straight out of the door, running CentOS, instead of bowing down to WIN7!!! LoL! TIA everyone! =]
# prompt display on your screen but i am sure you are login as non-root user.
Quote:
/home/shaun/bin
you are login as shaun user Am i right?
if yes then you have to give full path of command.
Yes... I am logged in with my user account shaun (Yea, my real name, hello btw!! LoL!) and then I su to get to root.... So if I am doing something wrong, or not doing it the 'right' way. Please lemme know. Again.... NOOB!!!!! su is all I've learned... So far. *evil grin*
Yes... I am logged in with my user account shaun (Yea, my real name, hello btw!! LoL!) and then I su to get to root.... So if I am doing something wrong, or not doing it the 'right' way. Please lemme know. Again.... NOOB!!!!! su is all I've learned... So far. *evil grin*
hi shaun
if you want to become root just run su command as below
[shaun@localhost ~]$ ifconfig
bash: ifconfig: command not found
[shaun@localhost ~]$ su
Password:
[root@localhost shaun]# ifconfig
bash: ifconfig: command not found
[root@localhost shaun]# su - root
[root@localhost ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:4F:05:CC
inet addr:10.11.8.22 Bcast:10.11.8.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe4f:5cc/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:581004 errors:0 dropped:0 overruns:0 frame:0
TX packets:388944 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:524565816 (500.2 MiB) TX bytes:306291525 (292.1 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1239 errors:0 dropped:0 overruns:0 frame:0
TX packets:1239 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2082593 (1.9 MiB) TX bytes:2082593 (1.9 MiB)
Worked. However, I know that su then ifconfig used to work. I know it did. I haven't taken any crazy pills in a couple of weeks (GOTTA get off that stuff!!), but I swear it worked before. And I'm not sure what I did to bork it (I had to have done something...)
$ vim .bash_profile
PATH=$PATH:$HOME/bin:/sbin <- add /sbin
save file and logout and login user
That worked like a champ! Didn't need to su. Granted, I see what it is that I did. Basically the same thing as W$ users "paths". Correct? You mentioned that this isn't really a fix, but more a test. Right?
Last edited by sheykh; 08-18-2010 at 11:34 AM.
Reason: fix quote
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.