Author Topic: Where's ifconfig?  (Read 2382 times)

Online daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3730
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Where's ifconfig?
« Reply #15 on: October 24, 2011, 12:23:27 PM »
okay, you have sbin in your path  ;)

Offline jwt873

  • Full Member
  • ***
  • Posts: 150
Re: Where's ifconfig?
« Reply #16 on: October 24, 2011, 01:04:23 PM »
Here's a tip I learned a while back to see if something is installed...

When searching for a specific utility program (from the command line), you can use the 'which' command.

[jim@localhost ~]$ which ifconfig
/sbin/ifconfig
[jim@localhost ~]$ which which
/usr/bin/which
[jim@localhost ~]$

Registered Linux user #166905 -- Registered on 2000-02-21 02:52:05 -- https://linuxcounter.net/

Offline YouCanToo

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 5333
  • Location: Lebanon, OR., USA
    • Spreading the word.......
Re: Where's ifconfig?
« Reply #17 on: October 24, 2011, 01:08:31 PM »
okay, you have sbin in your path  ;)

Why is it in some paths and not in everyone's path?




Be sure to visit the NEW Knowledge Base


Linux is user-friendly- it's just picky who its friends are!

Online daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3730
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Where's ifconfig?
« Reply #18 on: October 24, 2011, 01:12:19 PM »
okay, you have sbin in your path  ;)

Why is it in some paths and not in everyone's path?

I've no idea, why it is, sorry...

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: Where's ifconfig?
« Reply #19 on: October 24, 2011, 02:50:46 PM »
okay, you have sbin in your path  ;)

Why is it in some paths and not in everyone's path?

I have already seen this: different PCLinuxOS flavors have different PATH setup. From one side it's understandable, because something like /usr/lib/kde4/libexec is meaningful to KDE only, from another side the lack of /sbin as appear to be the case in this thread, is questionable.

[rudge12000@localhost ~]$ echo $PATH
/bin:/usr/bin:/usr/local/bin:/usr/games:/usr/lib/qt4/bin:/usr/bin:/usr/sbin:/usr/lib/kde4/libexec:/bin:/sbin:/usr/X11R6/bin:/usr/games:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/usr/lib/kde4/libexec:/bin:/sbin:/usr/X11R6/bin:/usr/games:/usr/local/bin:/usr/local/sbin:/home/rudge12000/bin:/usr/bin:/usr/sbin:/usr/lib/kde4/libexec:/bin:/sbin:/usr/X11R6/bin:/usr/games:/usr/local/bin:/usr/local/sbin
[rudge12000@localhost ~]$


Also, the duplicates entries like in Rudge's $PATH, IMHO aren't entirely correct ...

AS

Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6374
  • I'm going South
Re: Where's ifconfig?
« Reply #20 on: October 24, 2011, 04:32:38 PM »
okay, you have sbin in your path  ;)

Why is it in some paths and not in everyone's path?

I have already seen this: different PCLinuxOS flavors have different PATH setup. From one side it's understandable, because something like /usr/lib/kde4/libexec is meaningful to KDE only, from another side the lack of /sbin as appear to be the case in this thread, is questionable.

When I started using Linux many years ago the sbin directories were missing from ordinary users' paths in most distros I tried. This made sense as the executables in /sbin and /usr/sbin are there for administrative tasks and mainly intended to be run by root.

On the other hand I don't remember seeing a KDE version of PCLinuxOS where they wouldn't be found in my ordinary user's default path. This also makes sense as some of the programs in the sbin directories actually can be run by ordinary users. I don't think either solution is wrong.

Quote
[rudge12000@localhost ~]$ echo $PATH
/bin:/usr/bin:/usr/local/bin:/usr/games:/usr/lib/qt4/bin:/usr/bin:/usr/sbin:/usr/lib/kde4/libexec:/bin:/sbin:/usr/X11R6/bin:/usr/games:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/usr/lib/kde4/libexec:/bin:/sbin:/usr/X11R6/bin:/usr/games:/usr/local/bin:/usr/local/sbin:/home/rudge12000/bin:/usr/bin:/usr/sbin:/usr/lib/kde4/libexec:/bin:/sbin:/usr/X11R6/bin:/usr/games:/usr/local/bin:/usr/local/sbin
[rudge12000@localhost ~]$


Also, the duplicates entries like in Rudge's $PATH, IMHO aren't entirely correct ...

AS


Any program can add to the existing path and most scripts don't check for existing entries before they add their own. Creating a new default path won't help unless you can also find and edit all the scrips that are messing with your old one. But a few duplicate entries won't matter.

For instance the last part of Rudge's path (the final /usr/bin:/usr/sbin:/usr/lib/kde4/libexec:/bin:/sbin:/usr/X11R6/bin:/usr/games:/usr/local/bin:/usr/local/sbin) might have been added by /etc/profile.d/kde4env.sh.
« Last Edit: October 24, 2011, 04:54:03 PM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10623
  • MLUs Forever!
Re: Where's ifconfig?
« Reply #21 on: October 24, 2011, 05:05:00 PM »
Check the group membership of the user .......  they also affect what commands are available to users .....  when comparing two installs. For instance I also have access to such commands as fdisk from a user prompt, while others don't.
MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: Where's ifconfig?
« Reply #22 on: October 24, 2011, 05:17:30 PM »
okay, you have sbin in your path  ;)

Why is it in some paths and not in everyone's path?

I have already seen this: different PCLinuxOS flavors have different PATH setup. From one side it's understandable, because something like /usr/lib/kde4/libexec is meaningful to KDE only, from another side the lack of /sbin as appear to be the case in this thread, is questionable.

When I started using Linux many years ago the sbin directories were missing from ordinary users' paths in most distros I tried. This made sense as the executables in /sbin and /usr/sbin are there for administrative tasks and mainly intended to be run by root.

On the other hand I don't remember seeing a KDE version of PCLinuxOS where they wouldn't be found in my ordinary user's default path. This also makes sense as some of the programs in the sbin directories actually can be run by ordinary users. I don't think either solution is wrong.

That was exactly my point, I have used the terms "is questionable" meaning that "can be discussed"  ... (non native English here),
I can add that several other distros are currently using /sbin and /usr/sbin in user's PATH.

Quote
Quote
[rudge12000@localhost ~]$ echo $PATH
/bin:/usr/bin:/usr/local/bin:/usr/games:/usr/lib/qt4/bin:/usr/bin:/usr/sbin:/usr/lib/kde4/libexec:/bin:/sbin:/usr/X11R6/bin:/usr/games:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/usr/lib/kde4/libexec:/bin:/sbin:/usr/X11R6/bin:/usr/games:/usr/local/bin:/usr/local/sbin:/home/rudge12000/bin:/usr/bin:/usr/sbin:/usr/lib/kde4/libexec:/bin:/sbin:/usr/X11R6/bin:/usr/games:/usr/local/bin:/usr/local/sbin
[rudge12000@localhost ~]$


Also, the duplicates entries like in Rudge's $PATH, IMHO aren't entirely correct ...

AS


Any program can add to the existing path and most scripts don't check for existing entries before they add their own. Creating a new default path won't help unless you can also find and edit all the scrips that are messing with your old one. But a few duplicate entries won't matter.

... a few duplicate can affect a process performance when you run a script like:
Code: [Select]
for i in *
do
      [example executable in /home/rudge1200/bin]
done
when you run a script like the above, every time the example executable is called, the shell will search the command in each directory listed on the PATH until will find the right directory, every time the command is executed.


Quote
For instance the last part of Rudge's path (the final /usr/bin:/usr/sbin:/usr/lib/kde4/libexec:/bin:/sbin:/usr/X11R6/bin:/usr/games:/usr/local/bin:/usr/local/sbin) might have been added by /etc/profile.d/kde4env.sh.

Beside the performance issue, which may be ignored, PATH define also a precedence between commands, the first example that come to my mind is shutdown that is present in /sbin and in /usr/bin and are different executables. 

AS

Offline Vorteggs

  • Hero Member
  • *****
  • Posts: 2406
Re: Where's ifconfig?
« Reply #23 on: October 25, 2011, 05:48:17 AM »
Here's a tip I learned a while back to see if something is installed...

When searching for a specific utility program (from the command line), you can use the 'which' command.

[jim@localhost ~]$ which ifconfig
/sbin/ifconfig
[jim@localhost ~]$ which which
/usr/bin/which
[jim@localhost ~]$


The OP simply had to type his question in Terminal ;) :D:

[Vorteks@thenudiebar ~]$ whereis ifconfig
ifconfig: /sbin/ifconfig /usr/share/man/man8/ifconfig.8.bz2
[Vorteks@thenudiebar ~]$

Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6374
  • I'm going South
Re: Where's ifconfig?
« Reply #24 on: October 25, 2011, 08:48:40 AM »
okay, you have sbin in your path  ;)

Why is it in some paths and not in everyone's path?

I have already seen this: different PCLinuxOS flavors have different PATH setup. From one side it's understandable, because something like /usr/lib/kde4/libexec is meaningful to KDE only, from another side the lack of /sbin as appear to be the case in this thread, is questionable.

When I started using Linux many years ago the sbin directories were missing from ordinary users' paths in most distros I tried. This made sense as the executables in /sbin and /usr/sbin are there for administrative tasks and mainly intended to be run by root.

On the other hand I don't remember seeing a KDE version of PCLinuxOS where they wouldn't be found in my ordinary user's default path. This also makes sense as some of the programs in the sbin directories actually can be run by ordinary users. I don't think either solution is wrong.

That was exactly my point, I have used the terms "is questionable" meaning that "can be discussed"  ... (non native English here),
I can add that several other distros are currently using /sbin and /usr/sbin in user's PATH.

Quote
Quote
[rudge12000@localhost ~]$ echo $PATH
/bin:/usr/bin:/usr/local/bin:/usr/games:/usr/lib/qt4/bin:/usr/bin:/usr/sbin:/usr/lib/kde4/libexec:/bin:/sbin:/usr/X11R6/bin:/usr/games:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/usr/lib/kde4/libexec:/bin:/sbin:/usr/X11R6/bin:/usr/games:/usr/local/bin:/usr/local/sbin:/home/rudge12000/bin:/usr/bin:/usr/sbin:/usr/lib/kde4/libexec:/bin:/sbin:/usr/X11R6/bin:/usr/games:/usr/local/bin:/usr/local/sbin
[rudge12000@localhost ~]$


Also, the duplicates entries like in Rudge's $PATH, IMHO aren't entirely correct ...

AS


Any program can add to the existing path and most scripts don't check for existing entries before they add their own. Creating a new default path won't help unless you can also find and edit all the scrips that are messing with your old one. But a few duplicate entries won't matter.

... a few duplicate can affect a process performance when you run a script like:
Code: [Select]
for i in *
do
      [example executable in /home/rudge1200/bin]
done
when you run a script like the above, every time the example executable is called, the shell will search the command in each directory listed on the PATH until will find the right directory, every time the command is executed.

I see you point. The shell will stop searching once it's found the right executable but if there are duplicates of other directories it may repeatedly search for it several times in /bin and /usr/bin until it possibly finds it in /usr/sbin.

Quote
Quote
For instance the last part of Rudge's path (the final /usr/bin:/usr/sbin:/usr/lib/kde4/libexec:/bin:/sbin:/usr/X11R6/bin:/usr/games:/usr/local/bin:/usr/local/sbin) might have been added by /etc/profile.d/kde4env.sh.

Beside the performance issue, which may be ignored, PATH define also a precedence between commands, the first example that come to my mind is shutdown that is present in /sbin and in /usr/bin and are different executables.  

AS


I suppose that is why some scripts append their entries to the PATH variable while other scripts prepend them. If you wish to change the search order of the most important directories your additions should come before the old path; if you wish to minimize the disturbance caused by your additions, add them to the end of the path.

Nevertheless the strangest thing about Rudges PATH variable is that it seems to contain the path from /etc/profile.d/kde4env.sh -- not once, but twice. And this in spite of the fact that he doesn't run KDE but LXDE.

It's also interesting that /etc/profile.d/kde4env.sh appears to have been run first before ~/.bash_profile was read, and then once more afterwards. (How do I know this? It's normally ~/.bash_profile that adds the bin in the user's home directory to the PATH variable.)
« Last Edit: October 25, 2011, 01:12:02 PM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline demilord

  • Full Member
  • ***
  • Posts: 220
  • Windows not supported
Re: Where's ifconfig?
« Reply #25 on: October 27, 2011, 03:33:17 PM »
Same here working as user
Office required Windows XP or better, so I installed PCLinuxOS :D