Linux: pstree formatting

Today one of our developers came to me to discuss a problem and I wanted to show him something on one of our Linux machines. To check a process, I ran pstree and noticed that the formatting of the output was all wrong:

simon@atlas:~$ pstree
     â      ââsshdâââbashâââpstree
     â      ââsshdâââsshdâââsh

This is obviously just a cosmetical problem and the output is quite hard to read. When encountering something like this, the first guess would be that the encoding is somehow wrong. When checking the environment variables with env, we find that LANG is set to “en_US.UTF-8”.

So to get the correctly formatted output, we unset the LANG environment variable using unset LANG. After doing so, the output is now no longer cluttered and displayed correctly:

simon@atlas:~$ unset LANG
simon@atlas:~$ pstree
     |      |-sshd---bash---pstree
     |      `-sshd---sshd---sh

Alternative: Someone in the comments noted that you can also use

$ export LANG=ASCII

as an alternative to set the correct character set. I assume if no LANG is set, ASCII is used.

Hello world

My name is Simon Krenger, I am a Technical Account Manager (TAM) at Red Hat. I advise our customers in using Kubernetes, Containers, Linux and Open Source.


  1. GitHub
  2. LinkedIn
  3. GitLab