Linux Modify/etc/profile Configuration Error command is not found self-rescue method

Source: Internet
Author: User

My csdn blog address: Http://blog.csdn.net/caicongyang

Bloggers have previously modified the/etc/profile configuration file method, causing the bash command to be unavailable

The execution of the LS command results in the following:

[plain] view plain copy
    1. -bash:ls:command is not found


But fortunately the blogger backed up the/etc/profile before, so I restored the profile back to SSH, but now I need to execute

[plain] view plain copy
    1. # Source/etc/profile


Get the config file back into effect, and then the unfortunate thing is

[plain] view plain copy
    1. -bash:id:command is not found


Found source command no longer recognized!

After the degree of Niang mention point, we can use the command to re-path;

[plain] view plain copy
    1. # Export Path=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin


After executing the above command, you can re-execute the source/etc/profile command to get your profile to take effect

If unfortunately your profile configuration file is not backed up, you can add the command address in the case where the VI command is not available directly

[plain] view plain copy
    1. #/bin/vi/etc/profile

So you can use the VI command to modify it!

Linux Modify/etc/profile Configuration Error command is not found self-rescue method

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.