Command not found, system many commands are not used, modify environment variables

Source: Internet
Author: User

BASH: * *: Command not found, the system many commands are not used, are prompted not to this command.

All of a sudden, Linux has many commands that are not used, prompting for no such command.

This should be caused by a problem with the system environment variable.

Workaround:

First Use: Echo $PATH
See if path contains:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

If not

Use temporary environment variables (disappear after reboot)
#export path= $PATH:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

Then you can use those commands to go in and modify the persistent environment variable:

1. Modify Profile: (All users)

#vi/etc/profile
Join: Export path= $PATH:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
Save exit.

2. modify the. bashrc file: (Individual users)

#vi/~/.BASHRC (available per user directory, Ls-all)
Join: Export path= $PATH:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

Save exit.

Reboot the system and fix it.

You can also use the command without restarting: #source. BASHRC
To make the environment variable that you just modified take effect

Command not found, system many commands are not used, modify environment variables

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.