How should the environment variables be configured for the current user in Linux?
In Linux, you can configure the environment variables for the current user by following these steps:
- Open the terminal and log in to the user account where you want to set up the environment variables.
- Edit the environment variable configuration file of the current user. If you are using bash as your default shell, the environment variable configuration file is usually located at ~/.bashrc. You can open it with any text editor, such as vi or nano.
vi ~/.bashrc
- the directory where the executable files are stored is /usr/local/bin
export PATH=$PATH:/usr/local/bin
- Save and close the file.
- Apply the environment variable configurations. You can make the changes take effect by either reloading the bash configuration file or by closing and reopening the terminal.
source ~/.bashrc
You have successfully set up the environment variables for the current user. You can verify the settings of the environment variables by running the command echo $PATH.