Modify the/etc/profile file in Linux

Source: Internet
Author: User

Modify the/etc/profile file in Linux

Normally, the/etc/profile file is read-only and cannot be saved after being opened and modified using vi or gedit. To modify the profile, you must obtain the root permission (use gedit to edit) as follows:

$ Sudo gedit/etc/profile

Or

$ Sudo-s

$ Gedit/etc/profile

In this way, open the profile file and save it after modification.

How to make the modified profile take effect immediately:

Method 1:

$./Etc/profile

There is a space between. and/etc/profile

Issue 2:

$ Source/etc/profile

The source command is also called the "dot command", that is, a dot symbol (.). The source command is usually used to re-execute the modified initialization file to make it take effect immediately without logging out and logging on again.

This article permanently updates the link address:

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.