Apply environment variables to ~/ .profile


I am not sure how do we set the environment variable to the profile.


Hello, nitinainani
You can find this file in the $HOME directory of the working user. It’s contain the dot before the file name so it’s a hidden. You need to run the ls -a command to list the all files including hidden.

Hi nitinainani,

the file is the .profile notice the dot in front of the profile? This means it is a hidden file (viewable in the list with ls -la command). In order to add a variable to the .profile file and finally make it persistent, we can use another command, the echo command. Try using $ echo “export TEST=Hello” >> .profile

Within the " " you will put the text/variable that will be inserted (append) to the .profile file.
Hope this helps!