linux tree function

 

often used :

tree -a
print all file, do not pirnt hidden files

tree -d
list directories only

tree -f
show full path

-o filename
output result to a custom file

Combo with grep :
tree -a /var/log |grep gz
list all gz file under /var/log

practice :
tree -a /var/log -o /tmp/log.txt |grep gz

now cat /tmp/log.txt to see the result