LinuxQuestions.org
Latest LQ Deal: Linux Power User 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 03-31-2008, 09:56 AM   #1
acat800
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Rep: Reputation: 0
ifconfig command equivalent in Fedora


Guys, just installed Fedora 8 and the "ifconfig" command does not work. Is there an equivalent command in Fedora or is the command something that has to be installed?
 
Old 03-31-2008, 09:57 AM   #2
DotHQ
Member
 
Registered: Mar 2006
Location: Ohio, USA
Distribution: Red Hat, Fedora, Knoppix,
Posts: 545

Rep: Reputation: 33
Are you root when you run it?

the full path to the ifconfig binary is:
/sbin/ifconfig
 
Old 03-31-2008, 10:00 AM   #3
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
It is most likely installed, but not in the PATH of your non-root user (since it is an admin command for most purposes).
 
Old 03-31-2008, 10:02 AM   #4
acat800
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Yep... I run it as root but I get "command not found". I do see a file called "ifconfig" in /sbin/
 
Old 03-31-2008, 10:16 AM   #5
Ricio
Member
 
Registered: Sep 2003
Location: Colombia
Distribution: Debian
Posts: 220

Rep: Reputation: 30
if you see the file named ifconfig in sbin then the problem is that /sbin/ is not in your variables path, find out if it is by doing the following

do echo $PATH, as normal user and then as root.

if its not mentioned for neither user then you should do set PATH=$PATH:/sbin/ this adds the sbin to the path.
 
Old 03-31-2008, 10:26 AM   #6
acat800
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Original Poster
Rep: Reputation: 0
you may be on to something there because I do not see /sbin/ in the PATH list. However, the "set" command you gave me does not seem to add it to the list either. I ran it as root and user.
 
Old 03-31-2008, 10:44 AM   #7
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
The right command is
Code:
export PATH=/sbin:$PATH
but you should investigate why the correct path is not set. Usually it's set in /etc/profile. Here is the relevant part for root:
Code:
# Path manipulation
if [ "$EUID" = "0" ]; then
        pathmunge /sbin
        pathmunge /usr/sbin
        pathmunge /usr/local/sbin
fi
 
Old 03-31-2008, 10:57 AM   #8
Ricio
Member
 
Registered: Sep 2003
Location: Colombia
Distribution: Debian
Posts: 220

Rep: Reputation: 30
Is not set PATH=$PATH:/sbin is export PATH=$PATH:/sbin works like a charm in my debian box

sorry it was not set command it was export!

withouth the backslash at the end or try simply running withouth set, set works for me, im running debian lenny, had the same problem!

another thing that you can do, is doing soft links to other directories like this:

ln -s /sbin/ifconfig /bin/ifconfig

remember that most sbin programs must be run as root.

Last edited by Ricio; 03-31-2008 at 11:57 AM. Reason: The right command
 
Old 03-31-2008, 11:03 AM   #9
acat800
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Original Poster
Rep: Reputation: 0
well... I checked the /etc/profile file and I found the same exact syntax you quoted above but the command wasn't working. I then used the export command and now it's working perfectly as both root and user. Thanks for the help. Not sure why this didn't work out of the box. A bug perhaps?
 
Old 03-31-2008, 11:28 AM   #10
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
Don't look in the /etc/profile, it can be confusing. Instead, please post the output of the following commands, from the shell where you have the problem. Please copy-paste them - re-typing increases the chance of error too much:
Code:
id
echo $SHELL
type ifconfig
echo $PATH
ls -l {/bin,/usr/bin,/sbin,/usr/sbin,/usr/local/sbin}/ifconfig
mount |grep ^/dev
type ifconfig
 
Old 03-31-2008, 11:35 AM   #11
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Or just use the locate command. Here's what I get (from Ubuntu, since I was logged in there right now):
Code:
$ locate ifconfig
/usr/share/man/man8/ifconfig.8.gz
/F8/usr/share/man/man8/ifconfig.8.gz
/F8/usr/share/man/pt/man8/ifconfig.8.gz
/F8/usr/share/man/de/man8/ifconfig.8.gz
/F8/usr/share/man/fr/man8/ifconfig.8.gz
/F8/sbin/ifconfig
/sbin/ifconfig
/F7/sbin/ifconfig
/F7/usr/share/man/de/man8/ifconfig.8.gz
/F7/usr/share/man/fr/man8/ifconfig.8.gz
/F7/usr/share/man/pt/man8/ifconfig.8.gz
/F7/usr/share/man/man8/ifconfig.8.gz
 
Old 03-31-2008, 12:15 PM   #12
acat800
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Original Poster
Rep: Reputation: 0
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


echo $SHELL
/bin/bash

type ifconfig
ifconfig is /sbin/ifconfig

echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

ls -l {/bin:/usr/bin,/sbin,/usr/sbin,/usr/local/sbin}/ifconfig
ls: cannot access /bin:/usr/bin/ifconfig: No such file or directory
ls: cannot access /usr/sbin/ifconfig: No such file or directory
ls: cannot access /usr/local/sbin/ifconfig: No such file or directory
-rwxr-xr-x 1 root root 71628 2007-08-23 11:44 /sbin/ifconfig

mount |grep ^/dev
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
/dev/sda1 on /boot type ext3 (rw)
/dev/sdb1 on /mnt/windows type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)

type ifconfig
ifconfig is /sbin/ifconfig
 
Old 03-31-2008, 12:28 PM   #13
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
My question would be how did you switch to root to run the command ? did you su to root ?

When using su you need to add a space and a hyphen ( -) after su, so you will get root's environment. without the hyphen your PATH will not be updated..

su -

this is mentioned even in wikipedias description of su..
 
Old 03-31-2008, 12:46 PM   #14
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
I was going to ask something like farslayer's question too. You did not do the id command, so it is not possible to verify that you have switched to assume root permissions, although you should be able to at least execute ifconfig without being root.

So what happens when you enter the command:
Code:
ifconfig --version
and
Code:
ifconfig --help
 
Old 03-31-2008, 02:50 PM   #15
acat800
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Original Poster
Rep: Reputation: 0
that's probably it.. I just did

"su root"

haha... newbie. Thanks guys.
 
  


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
connecting /sbin/ifconfig to bash command ifconfig flammable2 Fedora 4 11-12-2005 07:58 AM
Require Linux/Perl equivalent command for windows Command alix123 Programming 7 08-19-2005 02:23 AM
equivalent command in fedora pa_ash Linux - Newbie 1 06-28-2004 02:52 AM
equivalent command in fedora pa_ash Linux - Software 0 06-28-2004 01:27 AM
ifconfig command shoot2kill Linux - Networking 10 10-22-2003 12:50 PM


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

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