Search code examples
linuxunixterminaltreetreeview

Alternative to "tree" command or a way to reduce tree output file size?


I want to do a "tree" output file on a lot of clients but in general i found that the file size lands around 100mb.

This is WAY to big so i wanted to ask if there is any alternative way or command to do it or any way to reduce the file size?

I want to create a HDD catalog file log for later review and to be able to do some statistics with the files.


Solution

  • For simulate the $ tree command when you are in a directory, you can use also this command:

    $ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//──/g' -e 's/─/├/' -e '$s/├/└/'
    

    Then you have a result similar to the output of $ tree command