Today, Chiang Kai-shek has the dig command test effect when you are debugging DNSMASQ to create a local DNS server, but the default Linux system does not seem to have the dig support component installed. Then there is the error prompt "-bash:dig:command not found".
Solve the problem of "Dig:command not found" quickly
The main problem is that the default system is missing the Bind-utils toolkit, which we directly yum the installation to see.
Yum-y Install Bind-utils
This way, we have no problem with the dig command after we install the toolkit.
Command not found solutions for various scenarios
Question One
If the newly installed system runs some very normal commands, such as: Shutdown,fdisk, the brazen hint: Bash:command not found. So
The first thing to consider is whether or not the $path in root contains these environment variables.
This is mainly the four:/bin,/usr/bin,/sbin,/usr/sbin.
Four main stores of Dongdong:
./bin:
Bin for the binary of the main place some of the system required to implement files such as: Cat, CP, chmod DF, DMESG, gzip, kill, LS, mkdir, more, Mount, RM, Su, tar and so on.
/usr/bin:
The main place to put some application software tools of the necessary implementation files such as C + +, g++, GCC, Chdrv, diff, Dig, Du, eject, elm, free, gnome*, gzip, htpasswd, KFM, Ktop, last, less, Locale, M4, make, man, Mcopy, NcFTP, newaliases, Nslookup, passwd, quota, smb*, etc.
/sbin:
Some of the main prerequisites for system administration are: Cfdisk, dhcpcd, Dump, E2FSCK, Fdisk, Halt, Ifconfig, Ifup, Ifdown, Init, Insmod, Lilo, Lsmod, MKE2FS, Modprobe, Quotacheck, reboot, Rmmod, runlevel, shutdown, etc.
/usr/sbin:
Put some of the prerequisites for network management such as: DHCPD, HTTPD, IMAP, IN.*D, inetd, LPD, named, Netconfig, NMBD, samba, sendmail, squid, swap, TCPD, tcpdump, and so on.
You can view the path in the Bash_profile in the home directory. If it is: path= $PATH: $HOME/bin will need to be added as follows:
Path= $PATH: $HOME/bin:/sbin:/usr/bin:/usr/sbin
Question two:
The problem is that shutdown-h now cannot be used under root permissions, prompting command not found!!
This is the underlying command, which was supposed to be the other side without root permissions. But then he took a screenshot of me and saw that it was true, and that the command had no grammatical errors, a little inexplicable feeling ...
Then I have been looking for solutions and problems! Finally, I found ... The answers are as follows:
-------------------------------------------------------------------------------------
Using the Linux process, I found a problem, when I used the SU command to become superuser, using some of the management system commands, such as shutdown, give me a "bash:shutdown:command not found". General ideas for solving problems:
First of all, this command must exist, can not find, it is estimated to be looking for the wrong path, I first looked at the shutdown command position:/sbin/shutdown, and then the Super User's search path: (can be obtained through the environment variable)
Env:
Path=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/x11r6/bin:/home/xishan/bin
After switching to root, I looked at the environment variable for the root user:
path=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/ X11r6/bin:/root/bin
The contrast is obvious, Su's super User's environment variable is very different, how can we get the root environment variable?
Isn't SU has other uses, man Su, looked, sure enough,
Su [OPTION] ... [-] [USER [ARG] ...]
-,-L,--login
Make the shell a login shell
It should be su-root/su-l/su--login to log in as root.
The problem has been solved.
But I used to use the NetBSD system, when using the SU command, you can also use the shutdown, without other commands, the two systems are similar to the kernel, you should be able to modify the environment variable to achieve the goal?
VI ~/.BASHRC
Added an export path= $PATH:/sbin
After the reboot, through the SU command, go to the superuser, and then look at the environment variables,
Path=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/x11r6/bin:/home/xishan/bin:/sbin
Add success, then test: shutdown, OK, the next direct use SU can be.