Say I have a directory structure that looks like this:
foo
|-- bar
| |-- 1
| |-- 2
| |-- 3
| |-- baz
| | |-- 4
| | |-- 5
| | |-- 6
| | |-- moo
| | | |-- 7
| | | |-- 8
| | | |-- 9
| | | `-- mar
| | | `-- maz
| | `-- moo2
| `-- baz2
`-- bar2
I know that I can use tree -C foo
to colour the output, so that folders appear in a certain colour, etc, like so:
However, another feature that would be very much nice to have is the ability to provide colour to the heading lines. Such that each level of indentation would have its own colour. E.g. the first level is red, the second level is green, the third level is blue, and so on. This would make it easier to distinguish heading levels when reading a long tree.
I've contrived half of a mock-up example to show what I mean:
Is there any tool or program which does this?
tree -C
. That solves a different problem, which is colouring the file/directory names. I would like to be able to colour the bars or characters which connect to each file/directory, according to their level of indentation. I could probably write a script to do this and pipe tree into it, but wanted to know if anyone had already invented that particular wheel. – Lou Jan 04 '23 at 15:02tree -C
. Sorry! – terdon Jan 04 '23 at 15:16