Simple Tree command

Posted by yaohong on Saturday, November 28, 2020

TOC

Simple Tree command

Using the follow command can view current folder tree:

find . -print| sed -e 's;[^/]*/;|____;g;s;____|; |;g'

output

$ find . -print| sed -e 's;[^/]*/;|____;g;s;____|; |;g'
.
|____composer.lock
|____LICENSE
|____README.md
|____.gitignore
|____build-phar.php
|____.git
| |____config
| |____objects
...

Below command only descend at most 2 directory levels:

find . -maxdepth 2  -e -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'

REFERENCE

Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal

「点个赞」

Yaohong

点个赞

使用微信扫描二维码完成支付