Character encoding is always a problem when communicating between Windows and Linux. And using the “tree” command is affected by this problem if you are connected to a Linux box using Putty on a Windows box. You will certainly get weird characters, probably squares.
For those who are not sure about what tree is. It is a command-line tool to list contents of directories in a tree-like format.
A solution to this problem is to force using plain ASCII characters:
You can also have an alias for this command, so that every time you type “tree“, it will force tree to use the ASCII charset automatically.
alias tree='tree --charset=ASCII'
And this is an example of what you will get as an output:
/tmp |-- claws-mail-1000 |-- keyring-x803mg | |-- control | |-- pkcs11 | `-- ssh |-- orbit-gdm [error opening dir] `-- virtual-user