6

(env) ➜ zhuaxia git:(master) ✗ tree /tmp/test
/tmp/test
└── 谢211220_3_8
├── album_description.txt
├── cover.jpg
├── 谢211220;210\230浩231_3_8.mp3
└── 谢211220_3_8.mp3

(env) ➜ zhuaxia git:(master) ✗ ls /tmp/test
谢安琪_3_8

Using tree command, some Chinese character is displayed as Unicode, but ls is OK.

1
  • I did not found the solution, but I found the error happens only when I sshed to Ubuntu from Mac OS X.
    – hailinzeng
    Commented Nov 19, 2016 at 14:13

2 Answers 2

14

I have problems same as you, but I did Google and found the answer! Just add the option

tree -N /name_of_directory

man tree reads:

-N     Print non-printable characters as is instead of as escaped octal numbers.

Tell me if this still does not work!

Also, you seem to use zsh?? I am not familiar with that. I use bash, though.

1
  • 1
    Worked perfectly with homebrew installed tree (on MacOS X). Thanks!
    – Patrick
    Commented May 16, 2019 at 3:35
0

In my case the dashes that results in indentation in tree rendering was replaced with some strange character 'a' with a hat. Either tree -A or LC_ALL= C tree would resolve the issue then.

You must log in to answer this question.

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