Centos5 execution host prompt command not found solution

  

When the -bash: host: command not found, we need to install the corresponding package

host this program is inside the bind-utils package

Solution

So first install bind-utils


The code is as follows: yum install bind-utils

Summary

A lot of default installation packages will have some toolkits that won't be installed, so you must understand the basics of related packages before installing.

centos prompts command not found Perhaps because of permission issues

Log in to centos5.4 via ssh, switch to the root account, and find a lot of commands prompting command not found, today I figured out what happened, Oh, it seems that we need to learn step by step from the basics. Knowledge points relate to user rights and user switching. Joe is a normal user and root is a super user.

The phenomenon is as follows: [joe@TRIXBOX1 ~]$ su Password: [root@TRIXBOX1 joe]# ifconfig bash: ifconfig: command not found

su command format su [-| -p] [-c command] [username] - : Switch user environment when switching current user -p : Do not switch user working environment when switching current user, ie keep current user working environment, this is the default value -c Command : Execute the command com m and username as the specified user: For the user to be switched, the difference between root

su and su - is omitted, which is the reason. # Switch to super user, do not switch user identity [root@TRIXBOX1 joe]# su Password: [root@TRIXBOX1 joe]# env| Egrep 'USER| LOGNAME| PATH| MAIL' USER=joe MAIL=/var/spool/mail/joe PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/joe /bin LOGNAME=joe

# Switch to superuser root and switch user identity [root@TRIXBOX1 joe]# su - Password: [root@TRIXBOX1 ~]# env |  Egrep 'USER| LOGNAME| PATH| MAIL' USER=root MAIL=/var/spool/mail/root PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin :/usr/sbin:/usr/bin:/root/bin LOGNAME=root [root@TRIXBOX1 ~]#

su - After the command, switch to the root environment [joe@TRIXBOX1 ~]$ su - Password: [root@TRIXBOX1 ~]# ifconfig eth0 Link encap:Ethernet HWaddr 00:15:60:9D:F1:A8 inet addr:192.168.6.55 Bcast:255.255.255.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:69028 errors:0 dropped:0 overruns:0 frame:0 TX packets:39738 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:102040430 (97.3 MiB) TX Bytes:3030863 (2.8 MiB) Interrupt:169 Memory:e0500000-e0510000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 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:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) [root@TRIXBOX1 ~ ]#

User Limited knowledge of aspects need to learn, huh

Copyright © Windows knowledge All Rights Reserved