I'm trying to create a profile in gnome-terminal that doesn't store bash history.

The easiest way to do that is to run export HISTIGNORE="*", but there is one problem, gome-terminal is executing command before running bash, so this variable is being overwritten.

I was thinking about using .profile or .bashrc, but I don't want it to execute every time bash starts and I don't know how to determine which profile is being used by gnome-terminal from within terminal.


Have you tried using env to run the shell in a custom environment e.g. /usr/bin/env HISTIGNORE='*' /bin/bash from the gnome-terminal Title and Command tab?

gnome-terminal custom command

This seems to work for me - although I can't help feeling there's a more efficient way that doesn't involve testing each command against the wildcard.

  • Thanks, it still will not work because $HISTIGNORE is being overwritten, but now I can pass other variable like gprofile=no_hist and add [ "$gprofile" == "no_hist" ] && export HISTIGNORE='*' at the end of .bashrc, so thank you again for getting me on the right track. – przemo Sep 5 '14 at 11:56

You should edit


file with root privilege. It is system-wide profile. Runs before ~/.profile

  • 1
    Why? Gnome-terminal command runs before shell including /etc/profile and I don't want it to run for all profiles every time, just when I choose specific profile. – przemo Sep 5 '14 at 11:51

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.