回答:
次の依存関係をインストールします。
sudo apt-get install aha wkhtmltopdf
次を使用して、treeコマンド出力をhtmlに保存しますaha。
tree -C -h | aha > foo.html
treemanページから、-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.
最後に、htmlをPDFにエクスポートしwkhtmltopdfます。
wkhtmltopdf foo.html foo.pdf
例:
cd /tmp
tree -C -h | aha > foo.html
wkhtmltopdf foo.html foo.pdf
xdg-open foo.pdf

tree -n -d --charset unicode > file。など。、それはかなりのように間違いはありませんが、私は私のデータファイルを放牧していたとき、私は、モノクロレーザープリンタでそれを使用する