LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 01-09-2012, 03:59 AM   #1
nanch
LQ Newbie
 
Registered: Jan 2012
Posts: 1

Rep: Reputation: Disabled
I can't run ifconfig


I have installed centOS, an tryn to run ifconfig and it keeps telling me command not found, wats the right directory to run the command from?
 
Old 01-09-2012, 04:02 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello and welcome to LinuxQuestions,

Are you running that as a regular user or as root? I suppose as a regular user which would mean that /sbin is not in your default PATH. Did you try running it with sudo like this:
Code:
sudo ifconfig
or
Code:
sudo /sbin/ifconfig
Looking forward to your participation in the forums. Have fun with Linux.

Kind regards,

Eric
 
Old 01-09-2012, 04:32 AM   #3
rockstar05
Member
 
Registered: Dec 2011
Posts: 83

Rep: Reputation: Disabled
If this is not working then please find the ifconfig file through / directory.

by,

find / -name ifconfig

and place in proper place /sbin directory

so you can use ifconfig command.

Thanks
 
Old 01-09-2012, 05:21 AM   #4
linuxmen
Member
 
Registered: Aug 2011
Distribution: fedora14,11, RHEL5, CentOS6, win2008R2, Win7
Posts: 45

Rep: Reputation: 4
Which version of CentOS ?
But all users can run ifconfig without any errors..

Last edited by Tinkster; 02-24-2012 at 05:41 PM.
 
Old 01-09-2012, 05:26 AM   #5
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by nanch View Post
I have installed centOS, an tryn to run ifconfig and it keeps telling me command not found, wats the right directory to run the command from?
lookout for the default location of command
Code:
#which ifconfig
/sbin/ifconfig

then try running the command this way
Code:
#/sbin/ifconfig
 
Old 01-09-2012, 05:31 AM   #6
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Quote:
Originally Posted by linuxmen View Post
Which version of CentOS ?
But all users can run ifconfig without any errors..
Hi,

That is not always true. Depends on how the system is set up. If you have a regular user with limited access, controlled by sudo for example and you didn't allow ifconfig (NETWORKING) then it will not work. Another issue is that for regular users /sbin might not be in the PATH statement so just running
Code:
ifconfig
,
even with sudo correctly setup and allowing the command, would error out whereas running
Code:
/sbin/ifconfig
would give the desired result.

Kind regards,

Eric
 
Old 02-26-2015, 03:40 AM   #7
Blommeke77
LQ Newbie
 
Registered: Feb 2015
Posts: 1

Rep: Reputation: Disabled
Hi All,

I know it is an old thread, but I ran into the same issue on my CentOS 7 server.
The solution for me was to install the net-tools because I couldn't find ifconfig on my machine at all.

Code:
yum install net-tools
After that I could succesfully execute ifconfig.
Since this thread pups up when searching for this issue, I think it's best to add all proper solutions.

Best regards,

John
 
  


Reply



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
pppoe connects but i need to run 'ifconfig eth0 up' please help.... deepclutch Debian 3 12-08-2005 10:03 AM
connecting /sbin/ifconfig to bash command ifconfig flammable2 Fedora 4 11-12-2005 07:58 AM
How to authorize common-user to run "ifconfig eth0 up"??? cqmyg5 Slackware 2 04-03-2005 11:22 PM
how to run ifconfig as root without super user terminal GUIPenguin Linux - General 1 01-15-2005 10:06 AM
im in user mode and cant run hdparm and ifconfig commands, but if im root, i can. kublador Linux - Newbie 2 09-12-2003 08:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:43 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
Open Source Consulting | Domain Registration