I want to set the environment variables MAILPATH and MAIL permanently (i.e. make them persistent)

I already tried the following:

export MAIL

This needs to be done every time I start a new bash shell (i.e., open new terminal etc.)

How do I make these settings permanent? I have tried setting these variables in /etc/environment but that does not make them persistent.

  • A side note, /etc/environment file is for system wide settings. You don't want to have same MAILPATH or such other settings pointing to your home directory made available to other users. help.ubuntu.com/community/EnvironmentVariables
    – user871199
    Sep 15, 2016 at 20:47
  • Please note that you can assign and export a shell environment variable in one single step: export MAILPATH=/home/don/Maildir
    – Byte Commander
    Sep 15, 2016 at 20:52

1 Answer 1


You can make it persistent by adding it to your ~/.bashrc file. This file is called every time you start an interactive bash shell.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.