Posted in Command Line, Linux Get the First Line of Command Output in Shell Binny V A July 7, 2007 Leave a Comment on Get the First Line of Command Output in Shell Get just the first line of the output of a command… <command>|head -n1 ls -1|head -n1 Author: Binny V AA philosopher programmer who specializes in backend development and stoicism.