windows or centos put the command into the PATH

In the Windows operating system, if you enter a command directly, a program that is neither an internal command nor a runnable will pop up.

For example, if you enter mysql, it will pop up a program that is not an internal command or is not executable. This is because the Windows operating system will find these commands through the PATH in the environment variable, so you need to set the path of the command in the PATH variable first.

Right-click My Computer - "Select Properties - "Advanced System Settings - "Environment Variables - "Find the PATH variable, modify the PATH in the user variable or the PATH of the system variable, because the system will first find the user variable, and then find the system variable. , through the path, find the path of the command

If it is a centos system, there are two methods:

1. Edit the /etc/ profile file,

Add: PATH=$PATH:/usr/nginx/sbin/:/usr/php/sbin, etc., put the nginx and php commands in the PATH, when you directly enter the nginx command, the system will find the file from $PATH path

2. Make a soft link

First print $PATH, echo $PATH; for example: /usr/local/sbin:/usr/local/bin:/usr/sbin:

ln -s /usr/nginx/sbin/nginx /usr/sbin; you can use the nginx command directly



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325849285&siteId=291194637