Visit the LQ Articles and Editorials section
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-30-2002, 05:54 PM   #1
LQ Newbie
Registered: Aug 2002
Posts: 2

Rep: Reputation: 0
Can't execute ifconfig at command line


Trying to use the ifconfig command from the command line; however, the terminal is not finding the command: "bash: ifconfig: command not found"

Could someone tell me is there something that I am missing.

The server is configured to use dhcp.

Old 08-30-2002, 05:55 PM   #2
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,547

Rep: Reputation: 160Reputation: 160
as root. Usually only root can run ifconfig.
Old 08-30-2002, 06:09 PM   #3
LQ Newbie
Registered: Aug 2002
Posts: 2

Original Poster
Rep: Reputation: 0

Thanks, that did the trick.

I am a newbie, so I have a follow up question: I have su to root user to execute the command; however, only by stating the path of /sbin/ifconfig would the command work--why is that?

Old 08-30-2002, 09:57 PM   #4
LQ Addict
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
You need to load the environment for root by appending - to su command
/bin/su -
without it you are invoking shell for root with the environment of current user, and usually regular users don't have /sbin, /usr/sbin in their path.


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 08:58 AM
remote command execute telnet with 1 command MPowers Linux - Networking 2 06-30-2005 07:31 AM
How to execute a command line in a shell script orgazmo Programming 5 05-09-2005 10:16 AM
Using FTP to execute command line commands remotely steve_2010 Solaris / OpenSolaris 4 02-13-2004 09:44 AM
PHP execute at command line gjmwalsh Mandriva 2 12-06-2003 02:03 AM

All times are GMT -5. The time now is 11:56 AM.

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