LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-12-2013, 03:11 PM   #1
albert0147
LQ Newbie
 
Registered: Oct 2013
Posts: 10

Rep: Reputation: Disabled
today ifconfig no work yesterday it did


Hello,
I am not a computer person. I am taking my second course at the local JUCO and have a question. The text book has : enter the command "ifconfig". I do this and it comes back with command not found. I then type "whereis ifconfig" then it says that "/sbin /ifconfig" so I type it and get on with the lab. I want to know why yesterday it was different and today it needs teh /sbin??
Take care
 
Old 10-12-2013, 04:19 PM   #2
Robhogg
Member
 
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

Rep: Reputation: 88
Hi albert,

Whether a command will be located depends largely on the contents of the $PATH environment variable. This is a list of directories (separated by colons), which will be searched for programs to execute. It can be different depending on your user and the version of Linux (among other things). For instance, /sbin is not in an ordinary user's $PATH in Debian by default, but it is (I think) in Ubuntu.

On my Debian laptop, you can see the difference, if I switch to the root user:

Code:
rob:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
rob:~$ sudo su - root
root:~# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
However, I could choose to add /sbin to $PATH as my ordinary user (and even make it permanent by adding it in my .bashrc file):

Code:
rob:~$ PATH=${PATH}:/sbin
rob:~$ export PATH
rob:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin
rob:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:19:b9:xx:xx:xx 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
...

Last edited by Robhogg; 10-12-2013 at 04:37 PM.
 
Old 10-12-2013, 09:51 PM   #3
albert0147
LQ Newbie
 
Registered: Oct 2013
Posts: 10

Original Poster
Rep: Reputation: Disabled
thanks RobHogg
It worked!
 
  


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
[Perl] Files from today or yesterday Cornholio Programming 2 11-27-2006 12:00 AM
I have no sound today...yesterday i did. TallAmericano Linux - Newbie 6 08-06-2006 10:12 AM
startx -- :1.0 worked yesterday but today.. slackist Linux - General 3 05-12-2005 11:35 AM
Yesterday I had audio, today I don't. mimsmall Linspire/Freespire 1 08-09-2004 05:43 PM
Today-Yesterday Axo LQ Suggestions & Feedback 6 07-15-2003 10:39 AM


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