How to Set and Unset Local, User and System Wide Environment Variables in Linux

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Gunjit Khera

Currently a Computer Science student and a geek when it comes to Operating System and its concepts. Have 1+ years of experience in Linux and currently doing a research on its internals along with developing applications for Linux on python and C.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

13 Responses

  1. Azad says:

    Is there any api to get list of only user defined environment-variables ?

  2. Ritesh Vishwakarma says:

    As mentioned “.bashrc” – This file is user specific file that gets loaded each time user creates a new local session” But, it works from remote session as well.

  3. Bruno says:

    The title is “How to Set and Unset Local, User and System Wide Environment Variables in Linux”.
    Your article is only about bash…

    Either your title is wrong (given linux is the kernel, and you cannot pre-suppose people use GNU)
    Either the contents is wrong (if I use tcsh on my linux system for example)

  4. DiViNe says:

    Just great, thank youn very much!

  5. Vijendrakumar Y says:

    Very helpful easy to follow article.

  6. Edik says:

    I need a tool that will let me to have a variable shared between all sessions.
    I think any of this examples do not provide that functionality.

  7. Piter says:

    Hi, thank you for your post… I didn’t found /etc/bash.bashrc on centos7.
    Thank you for your job

  8. kerny says:

    .bash_profile is sourced by login shell, it has nothing to do with ssh, ssh connection can be login less.

  9. Jalal Hajigholamali says:

    Thanks a lot…
    very nice article…..

  10. snoozinux says:

    And I comment out all the garbagifar in /etc/profile.d in and…

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.