Add environment variables in Linux (Red Hat Linux 9)

Source: Internet
Author: User

I just learned about Linux, A cainiao, and I don't know anything. I enter ifconfig in the terminal to view the network configuration information, but the ifconfig command cannot be found. Then I can switch to root. I have had an interview on wubantu. What is the problem? I checked it online because no environment variable was added. The ifconfig command exists in/sbin. Use echo $ path to view the normal user environment variables without/sbin.

There are several ways to add environment variables to different places on the Internet. There is a temporary one, and it will lose effect after exiting the terminal. And long-lasting. One of these methods is to modify the/etc/profile file. This method is used.

Switch to the root permission and modify the profile file.

Su-Root

Gedit/etc/profile

Add export Path = "/sbin: $ path" at the end of the file, save and exit.

Log out of logout as the root user and switch to the common user.

If no error is reported for source/etc/profile, the execution is successful.

Ifconfig displays the network configuration information again, indicating that the modification is successful.

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.