select always the first row

Hi, I have an output like this:

#CMD

Output:
user1
user2
user3
user4

How can I select ONLY the first row?

Thanks

man head
CMD | head -1

'line' is very good at this:

  • not waiting for even the first byte of the second line, saving delay if the flow is intermittent.
  • leaving all following lines on the fd for other processes sharing it to read, which can save you a lot of CPU on a big file.
    text . . . |( line >header_file.txt whatever_cmd_reading_rest )

In ksh, 'read', as in:

. . . | read l
echo $l

but

  • this trims white space
  • ksh reads more than the first line, since stdin is a FILE*.

OK, thanks!