Search code examples
unixls

Trying to list 8 entries only with ls


I'm new to Unix and trying to teach myself navigation.

I'm trying to make an alias in my .bashrc file, that will list the first 8 entries of my home folder.

alias start= "ls -1 ~"

is what I've figured out so far, How would I limit it to only 8 though? I can't find any arguments in the ls command that would do this!


Solution

  • Use head to get the first 8.

    alias start='ls -1 ~ | head -8'