Hi,

On Mon, Jun 03, 2024 at 03:52:54PM +0200, Franco Martelli wrote:
> "tree" detects that its std output goes through a pipe and
> therefore it disables the escaped code to colorize (like also
> "dmesg" does). To avoid this behavior you must use the "unbuffer"
> command:
> 
> unbuffer tree --du -Fah /usr/local | grep /$

If that's the only thing you're using unbuffer for, why not just use
the -C option of tree? It's a bit like the "--color=always" of ls.

> You can also try:
> 
> ~# unbuffer dmesg | grep snd

Similarly dmesg has "--color=always".

I guess one advantage of unbuffer for this purpose is that you don't
need for an option to exist or to know what it is if it does.

Thanks,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting

Reply via email to