How to override the system locale on a single command?

Posted by Alistair Buxton on Ask Ubuntu See other posts from Ask Ubuntu or by Alistair Buxton
Published on 2012-11-23T02:05:19Z Indexed on 2012/11/23 5:10 UTC
Read the original article Hit count: 130

Filed under:

When helping someone we often ask them to show the output of a command eg:

sudo fdisk -l | pastebinit

If the user is not using an English locale, the output may be in a foreign language:

Disk /dev/sda: 750.2 GB, 750156374016 bytes
255 huvuden, 63 sektorer/spår, 91201 cylindrar, totalt 1465149168 sektor

This complicates support. How can one run a command with an override on the system locale to get English output?

© Ask Ubuntu or respective owner

Related posts about command-line

Related posts about locale