今天在写文章的时候发现tree 命令乱码:

macbook:blog thiswind$ tree source
/source
/├── 404
.md├── CNAME
├── _posts
│   ├── Tree-?\221
?令中?\226\207乱?\201?\227??\230?\232\204解?\206?.md│   ├── hello-world.md
│   └── ?\207
??\224?软件.md├── about
│   └── index.md
├── categories
│   └── index.md
├── debug.log
├── favicon.ico
└── tags
    └── index.md

    4
 directories, 10 files    macbook:blog thiswind$

解决办法是tree命令加上-N参数,如下

tree -N
macbook:blog thiswind$ tree -N source
/source
/├── 404
.md├── CNAME
├── _posts
│   ├── Tree-命令中文乱码问题的解决.md
│   ├── hello-world.md
│   └── 自由软件.md
├── about
│   └── index.md
├── categories
│   └── index.md
├── debug.log
├── favicon.ico
└── tags
    └── index.md

    4
 directories, 10 files    macbook:blog thiswind$