Home  >  Article  >  Operation and Maintenance  >  Linux system commands cannot be used

Linux system commands cannot be used

王林
王林Original
2020-01-14 09:34:303211browse

Linux system commands cannot be used

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn