Today, when you configure the environment on the Aliyun virtual machine,-bash: * * *: Command not found error, search the Internet, the following methods:
such as input ls: appears-bash:ls:command not found
Ipconfig appears-bash:ipconfig:command not found
First echo $PATH find. Display Java_home/bin:. Path:/root/bin
Reason: When setting the environment variable, the edit profile file is not written correctly, resulting in the command not being recognized at the command line. Solution:
Export Path=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
Echo $PATH found. Show/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
to the above will only be valid for this landing shell, if permanently available, you must do the following:
Open the/etc/profile with a text editor and add the path. Configure for me as follows
Before the configuration:
J ava_home=/usr/java/jdk1.7.0_40
Classpath=.:. Java_home/lib.tools.jar
Path=. Java_home/bin:. PATH
Export Java_home CLASSPATH PATH
Add path following
#set Java Environment
Java_home=/usr/java/jdk1.7.0_40
Classpath=.:. Java_home/lib.tools.jar
Path=. Java_home/bin:. Path:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
Export Java_home CLASSPATH PATH
Why would you do that?
The
should first consider whether or not the environment variables are already contained in the $path of root. &NBSP
is the main four:/bin,/usr/bin,/sbin,/usr/sbin. &NBSP
Four main stored dongdong:
./bin:
bin for binary the main place to put some of the system's prerequisite executable files such as: Cat, CP, chmod DF, DMESG, gzip, kill, LS, mkdir, more, Mount, RM, Su, tar and so on. &NBSP
/usr/bin:
Key prerequisites for applying software tools 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. &NBSP
/sbin:
Mainly places system-managed Prerequisites for example: Cfdisk, dhcpcd, Dump, E2FSCK, Fdisk, Halt, Ifconfig, Ifup, Ifdown, Init, Insmod, Lilo, Lsmod, MKE2FS, Modprobe, Quotacheck, reboot, Rmmod, runlevel, shutdown, etc. &NBSP
/usr/sbin:
To place some of the prerequisite programs for network administration, such as DHCPD, HTTPD, IMAP, IN.*D, inetd, LPD, named, Netconfig, NMBD, Samba, sendmail, squid, swap, TCPD, tcpdump, etc. &NBSP