find /lib -maxdepth 4 -name ".*" -prune -o -print|perl -wne 'push @A,$_;END{my $lm=0;my %fill;print reverse map {s!^(.*/)!$_=()=$1=~m{/}g;(("| ") x ($_-1))."+--"!e;my $m=index($_,"+");for (keys %fill){delete $fill{$_}if $_>$m};$fill{$m}=1;for (my $i=0;$i<$m;$i+=3){substr($_,$i,1)=" "if !exists $fill{$i};substr($_,$m,1)="\\";$lm=$m if $lm!=$m};$_}reverse sort @A}'Produce:
+--lib
\--apparmor
| \--functions
| \--profile-load
\--bridge-utils