Simple and straightforward! <command> | head -n 1; <command> | sed 1d | sort <....> - sed nd ---> 'n' specifies line no., and 'd' stands for delete.