8
votes
4answers
6k views

How do I limit the number of files printed by ls?

Is there a way to limit the quantity of listed files on a ls command? I've seen: ls | head -4 but to get head to be executed I need to wait for ls to finish execution, and with directories with an ...