I want to keep only the last line of tree
's output or the file+directory count report. Preferably, with the -a
switch.
An example output I desire:
585 directories, 37722 files
Is this possible with tree
?
tail
is a standard filter to print last line(s). To print one last line use tail -n 1
.
tree -a | tail -n 1
tree
that would skip listing. That would take some time if a directory is big. – Sepp A Feb 06 '23 at 13:17command to output file and directory count
instead of tree command to only output file and directory count?. It's very simple to count in awk or perl – phuclv Feb 06 '23 at 14:31