Search code examples
unixls

Unix command to get top 10 from the sorted file names in current directory


I understand that the command to list alphabetically the file names in current directory is ls.

But how can I get top 10 from the sorted file names in current directory?


Solution

  • Use the command "head" to get the first ten lines:

    ls | head -10