LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 11-25-2008, 09:56 AM   #1
bachelorlko
LQ Newbie
 
Registered: Nov 2008
Posts: 2

Rep: Reputation: 0
SOme commands are not found in /usr/bin directory


Hi
I have installed Redhat 5.0( 2.6.18-8.el5).I could not find some commands like Ifconfig,Fdisk,i have tried to run the same commands as a root also nut,it also did'nt work,please help.Thanks in Advance.
Yusuf
 
Old 11-25-2008, 10:35 AM   #2
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
I used this handy little feature I have in KDE called "Find Files/Folders" which is equivalent to the "Search" in Windows and found both of them in /sbin.
I have heard in the past that in Red Hat distros you need to switch user with "su-" or "su -" to get full root permission.
 
Old 11-25-2008, 10:38 AM   #3
geek_man
Member
 
Registered: Nov 2007
Distribution: Fedora 7, Fedora 9, Solaris 10, Mac OS X, RHEL5
Posts: 71

Rep: Reputation: 15
Commands like ifconfig and fdisk have to be executed as root.
So you have to do the following:
$ su -
Password: Enter your password
# Now you are root and can use ifconfig and those commands.

By the way if you are trying to become root just by typing "su" you wont be able to use those commands, because you dont have the complete root PATH.

Last edited by geek_man; 11-25-2008 at 10:40 AM.
 
Old 11-25-2008, 10:47 AM   #4
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
You have to be fully root. but with a su then do /sbin/ifconfig and see if that works.
 
Old 11-25-2008, 10:49 AM   #5
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by Junior Hacker View Post
I used this handy little feature I have in KDE called "Find Files/Folders" which is equivalent to the "Search" in Windows and found both of them in /sbin.
I have heard in the past that in Red Hat distros you need to switch user with "su-" or "su -" to get full root permission.
That is so true. It through me off the first time I installed and tried to run ifconfig. I was like why does root not have access to sbin. Then I did a su - and it worked perfectly. so in short you do have to take on full root permissions or use the full path to the command.
 
Old 11-25-2008, 10:50 AM   #6
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
if you don't include the "-" with the su command your environment (PATH) does not get updated and the system will not be able to locate those command binaries, as mentioned above.

I never issue su without including the hyphen. it's sorta pointless.
 
Old 11-25-2008, 10:51 AM   #7
aenright
Member
 
Registered: May 2005
Location: San Antonio, TX
Distribution: CentOS/Fedora/RHEL/FreeBSD/HPUX/Solaris
Posts: 46

Rep: Reputation: 16
Wink Some command line tools...

bachelorlko,

Some command line tools you can try are which and locate here is what it looks like on one of my systems:

Code:
$ su -
Password: 
[root@whisper ~]# which ifconfig
/sbin/ifconfig
[root@whisper ~]# locate ifconfig
/sbin/ifconfig
/usr/share/man/de/man8/ifconfig.8.gz
/usr/share/man/fr/man8/ifconfig.8.gz
/usr/share/man/man8/ifconfig.8.gz
/usr/share/man/pt/man8/ifconfig.8.gz
/usr/share/zsh/4.3.4/functions/_ifconfig
[root@whisper ~]#
When you swich user to root, make sure you use the - as this tells swich user to transfer root's full path.

Hope this helps,
~Art
 
Old 11-25-2008, 03:33 PM   #8
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
I could not find some commands like Ifconfig,Fdisk
Those commands are ifconfig and fdisk
Remember: linux is casE sensitivE !
 
Old 11-25-2008, 03:46 PM   #9
mikaeli
LQ Newbie
 
Registered: Nov 2008
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by bachelorlko View Post
Hi
I have installed Redhat 5.0( 2.6.18-8.el5).I could not find some commands like Ifconfig,Fdisk,i have tried to run the same commands as a root also nut,it also did'nt work,please help.Thanks in Advance.
Yusuf
You can also try whereis command. Just open command shell and type in
> whereis ifconfig

and you will get the location of the file as a reply.
 
Old 11-26-2008, 02:19 AM   #10
bachelorlko
LQ Newbie
 
Registered: Nov 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Thumbs up

Thanks everybody for overwhelming response,i have found out the Fdisk and the other commands in /sbin and have updated the PATH ,it's working fine.
Thanks Once again
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/usr/bin/emacs: No such file or directory...yet it exists andeity Linux - General 6 04-16-2006 09:54 PM
Error when starting up snort: bash:!/bin/sh/usr/local/bin/snort :Eent not found cynthia_thomas Linux - Software 1 11-11-2005 03:59 PM
path in services wrong for clamav updated frm 0.75 to 0.80 usr/bin vs usr/local/bin Emmanuel_uk Linux - Newbie 3 04-22-2005 02:02 AM
Cannot Enter chroot /usr/bin/env directory not found Zero-0-Effect Linux From Scratch 2 03-13-2004 01:41 PM
bin/bash:usr/bin/lpr NO SUCH FILE OR DIRECTORY Adibe_Hamm Linux - Newbie 3 10-14-2003 03:30 AM


All times are GMT -5. The time now is 10:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration