How can I format the output of a tree command so that the formatting of ls, e.g. highlighting and colour scheme of directories and certain file types applies to the output? The problem is when I restrict the depth of tree to say 2, if there are any directories in the final level, there is not a noticeable difference between dirs and files. So someway to easily distinguish between the two, whilst displaying both files and dirs would be great. Any help would be appreciated.
tree -C
-C
Turn colorization on always, using built-in color defaults if the
LS_COLORS
environment variable is not set. Useful to colorize output to a pipe.
see man page.
I usually use tree with Level 2, so this my favorite alias:
tre='tree -CL 2'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With