답변:
다음 종속성을 설치하십시오.
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. 확실히 예쁘지는 않지만 데이터 파일 등을 묶을 때 흑백 레이저 프린터와 함께 사용합니다.