How to configure environment variables in CentOS 7?
To set up environment variables on CentOS 7, you can follow these steps:
- Open the ~/.bashrc file using any text editor.
- Open the .bashrc file by using the command vi ~/.bashrc.
- Add the necessary environment variables at the end of the file, such as adding /usr/local/bin to the PATH variable.
- Add /usr/local/bin to the existing PATH variable.
- Save and close the file.
- Execute the following command to apply the configuration:
- Execute the .bashrc file.
- Check if the environment variables have been successfully configured by running the following command to view the value of the PATH variable:
- Print out the value of the PATH variable.
- If you see the added environment variables, it means the configuration was successful.
Please note that if you want to configure environment variables for all users, you can use the /etc/profile file, but modifying this file requires root permission.