This problem occurs because the system environment variables are not configured correctly. There are many reasons for this, such as system upgrades, improper operations, etc., which cause the environment variables to be overwritten and modified. Solve There are two ways.
Method 1: Enter the following directly on the Linux command line interface, and then press Enter (import environment variables and storage addresses of common shell commands):
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
Recommended learning video tutorial: linux video tutorial
Method 2: If all commands in the system cannot be used, you can also use the absolute command vi to open profile
/bin/vi /etc/profile
and add it to the system configuration file Environment variable address
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
Recommended related articles and tutorials: linux tutorial
The above is the detailed content of Linux system commands cannot be used. For more information, please follow other related articles on the PHP Chinese website!