LinuxQuestions.org
Help answer threads with 0 replies.
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 08-30-2002, 04:54 PM   #1
jhsuan
LQ Newbie
 
Registered: Aug 2002
Posts: 2

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


Hi,

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.

Thanks.
 
Old 08-30-2002, 04:55 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Try
/sbin/ifconfig
as root. Usually only root can run ifconfig.
 
Old 08-30-2002, 05:09 PM   #3
jhsuan
LQ Newbie
 
Registered: Aug 2002
Posts: 2

Original Poster
Rep: Reputation: 0
Smile

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?

Thanks.
 
Old 08-30-2002, 08:57 PM   #4
neo77777
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.
 
  


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

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

All times are GMT -5. The time now is 05:08 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