My Linux file system has tens of thousands of files per directory. Viewing a list of all the files takes a few minutes for my system to calculate, which is too slow. But I am not sure what files are in each directory so want to view a list of the first few, like what the head command does for large files. Is there a command that efficiently does this?
Edit: Piping ls to something else is no good because ls takes a few minutes to complete, before piping the output. I need a command that will only return the first few records.