How do I change environment variables in Linux?

Ngô Quốc Huy

New member
How do I change environment variables in Linux?
Answer
To make an environment persistent for a user’s environment, we export the variable from the user’s profile script.
  1. Open the current user’s profile into a text editor. vi ~/.bash_profile.
  2. Add the export command for every environment variable you want to persist. export JAVA_HOME=/opt/openjdk11.
  3. Save your changes.
 

Tìm kiếm

Back
Top