linux下ifconfig、shutdownなどのコマンドは使用できません_Shellコマンドを開く

2277 ワード

     RedHat Linux 5       ifconfig   

     RedHat Linux 5   ,         , : ifcinfig      IP,         ,   “command not found”,      ?             ,            ,    :

1、          ,        ,          PATH     ,   echo $PATH      ,     PATH         :
  (   /sbin PATH     )
  (1)                    ,         ,  :
    export PATH=$PATH:/sbin
  (2)            , :
   ~/.bash_profile              PATH=$PATH:$HOME/bin   :/sbin,   PATH=$PATH:$HOME/bin:/sbin
            ,  source ~/.bash_profile             。
  (3)                , :
   /etc/profile      export PATH=$PATH:/sbin
            ,  source etc/profile             。
       2、         
[root@admin007]# /sbin/ifconfig
     /etc/profile   
[root@amdin007]# vi /etc/profile
   if      
# Path manipulation
if [ "$EUID" = "0" ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi
   :
# Path manipulation
#if [ "$EUID" = "0" ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
#fi
        ,      !     
             ,         ,        。

linux起動レベルの設定
/proc       

  cat   /proc/cpuinfo   -   CPU   (i.e.   vendor,   Mhz,   flags   like   mmx) 

  cat   /proc/interrupts   -      

  cat   /proc/ioports   -     IO   

  cat   /proc/meminfo   -       (i.e.   mem   used,   free,   swap   size) 

  cat   /proc/partitions   -             

  cat   /proc/pci   -   PCI      

  cat   /proc/swaps   -     Swap      

  cat   /proc/version   -   Linux    



# 0 - halt (Do NOT set initdefault to this)   (       )

# 1 - Single user mode      
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)      ,    NFS

# 3 - Full multiuser mode         
# 4 - unused    
# 5 - X11      
# 6 - reboot (Do NOT set initdefault to this)   (       )

RedHat        ,    /etc/inittab,      id:?:initialization   ,  ?  [0-6],             5,            [1-3]。