Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

tree does this, don't know about suppressing the actual tree, but it tells you number of files and dirs printed at the end.


A regex match will do that easily enough:

    tree | egrep -o "[0-9]+ file(s|)"
edit: or you could just tail the output (should have thought of this first!)

    tree | tail -n1


alas it does not show file count per subdirectory




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: