Find the answer to your Linux question:
Results 1 to 3 of 3
Hi all, When i am as root , I can not execute any command in /sbin directiory without including the prefix /sbin . For instance: Code: [root@localhost hdm]# ifconfig bash: ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! beginner's Avatar
    Join Date
    Feb 2006
    Location
    Kiel, Germany
    Posts
    32

    Angry (FC6) How to include /sbin directory in PATH environment variable?


    Hi all,
    When i am as root, I can not execute any command in /sbin directiory without including the prefix /sbin. For instance:
    Code:
    [root@localhost hdm]# ifconfig
    bash: ifconfig: command not found
    In oder to execute the command ifconfig i have to enter: /sbin/ifconfig
    Code:
    [root@localhost hdm]# /sbin/ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:0E:35:6B:AD:35
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
              Interrupt:11 Base address:0x8000 Memory:cffff000-cfffffff
    
    eth1      Link encap:Ethernet  HWaddr 00:0E:7B:CD:01:21
              inet addr:192.168.0.230  Bcast:192.168.0.255  Mask:255.255.255.0
              inet6 addr: fe80::20e:7bff:fecd:121/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:4404 errors:0 dropped:0 overruns:0 frame:0
              TX packets:3841 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:4782914 (4.5 Mb)  TX bytes:478268 (467.0 Kb)
    
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:220 errors:0 dropped:0 overruns:0 frame:0
              TX packets:220 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:14344 (14.0 Kb)  TX bytes:14344 (14.0 Kb)
    Here is my PATH environment variable:
    Code:
    [root@localhost hdm]# echo $PATH
    /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/hdm/bin
    Please help me to include /sbin directory in PATH environment variable

    Thanks in advance.

  2. #2
    Linux Newbie Pythagoras's Avatar
    Join Date
    Aug 2006
    Location
    Moscow, Russia
    Posts
    205
    Code:
    # echo export PATH=/sbin:/usr/sbin:/usr/local/sbin:/root/bin:$PATH >> /root/.bashrc
    2b|!2b, that is the question

    If substraction add to multiplication you will get a division.

    GDB has a 'break' feature. Why doesn't it have a 'fix' too?

    Registered Linux User #437662

  3. #3
    Just Joined! beginner's Avatar
    Join Date
    Feb 2006
    Location
    Kiel, Germany
    Posts
    32
    Quote Originally Posted by Pythagoras
    Code:
    # echo export PATH=/sbin:/usr/sbin:/usr/local/sbin:/root/bin:$PATH >> /root/.bashrc
    Thank you, It is working now!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •