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

Your ls command may create columns. To list one item per line and count the lines: `ls -1 | wc -l`


ls usually switches to one column automatically when it's output is piped: https://i.vgy.me/cNfMzV.png




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: