Home > Operation and Maintenance > Linux Operation and Maintenance > How to solve the problem that all commands cannot be used in Linux

How to solve the problem that all commands cannot be used in Linux

WBOY
Release: 2022-05-23 17:47:01
Original
8593 people have browsed it

Method: 1. Enter "export PATH=/usr/local/sbin..." directly on the Linux command line page and import the environment variables; 2. Use the absolute command vi to open profile, the syntax is /bin/ vi /etc/profile" and add the environment variable address in the configuration file.

How to solve the problem that all commands cannot be used in Linux

The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

How to solve the problem that all commands cannot be used in Linux

This problem occurs because the system environment variables are not configured correctly. There are many reasons for this, such as system upgrades, such as improper operations. Solved There are two ways.

One: 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
Copy after login

Second: If all commands in the system cannot be used, you can also use the absolute command vi to open profile

   /bin/vi  /etc/profile
Copy after login

Add the environment variable address to the system configuration file

   export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
Copy after login

Extended knowledge:

What should I do if Linux does not support all commands? Solve the problem that all Linux commands cannot be used

This problem indicates that there is a problem with your /etc/profile configuration. Usually it is because there is a problem with the path configuration. Eliminate the errors in the added content, and then restart a new window to execute source /etc/profile to solve the problem.

When all commands cannot be used, vi will also be lost. Function.

At this time, you need to use the absolute path of the shell command to call the command.

# 编辑profile文件
/usr/bin/vim /etc/profile
Copy after login

Then execute it in a new window

source /etc/profile
Copy after login

Recommended learning:Linux video tutorial

The above is the detailed content of How to solve the problem that all commands cannot be used in Linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template