Workarounds for Linux basic commands not available

Source: Internet
Author: User

http://blog.csdn.net/houmou/article/details/51020709 Problem Description

http://blog.csdn.net/houmou/article/details/51020709

Recently, a new SSH client, found a lot of commands can not be used such as: LS, VI, CAT, ETC., hint:

-bash:xx:no such file or Directory12

But in other not closed SSH terminal can be used, speculation is the problem of/etc/profile file, the display $path after the discovery is not correct; switch root permission to modify the profile file, found that VI command can not be used, finally Baidu to the solution.

Workaround

Executing the following statement in the SSH terminal allows the environment variables in this session terminal to function

Export Path=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin12

Then modify the/etc/profile file, and the system returns to normal after re-source

Postscript
    1. Later found because someone modified the profile file, used $PATH=<newpath> , and did not use the ":" Stitching the original $PATH , causing the path lost important environment variables

    2. The CD can still be used in the event of a problem, the <Tab> key can also play the role of LS


Workaround for Linux basic commands not available

Related Article

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.