Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently I'm using Ubuntu with my system locale and language set to Japanese. However I'd like to have it always displaying gcc messages in English as it would be easier for me.

I found here if I did ~$ LC_MESSAGES=C gcc it displays in English. How can I make it so it's always like this without entering in ~$ LC_MESSAGES=C gcc every time and without changing my system language? All I want changed is "gcc".

share|improve this question

migrated from Oct 12 '12 at 4:34

This question came from our site for professional and enthusiast programmers.

up vote 2 down vote accepted

Create an alias in your shell.

alias gcc="LC_MESSAGES=C \gcc"
share|improve this answer
That was easy! Thank you. – きりcut Oct 11 '12 at 23:03

The trouble with an alias will be that they don't transfer to things like make very reliably. If I needed to do it, I'd probably create a shell script called gcc in my $HOME/bin directory which would set the environment variable and execute the 'real' gcc. My own bin directory is always on my PATH ahead of system directories. Hence:

LC_MESSAGES=C exec /usr/gcc/v4.7.1/bin/gcc "$@"
share|improve this answer

Try setting LC_MESSAGES=C in your users ~/.profile


EDIT Yeah don't use that it will change LC_MESSAES locale for all applications under your user that use it. Credit to Ignacio Vazquez-Abrams

share|improve this answer
"... and without changing my system language?" – Ignacio Vazquez-Abrams Oct 11 '12 at 23:47
@Ignacio Vazquez-Abrams ...yeah you're right. It will affect more then just gcc messages for this user. However it doesn't change the overall systems language. – iddqd Oct 12 '12 at 2:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .