How do I display the top part of a file?



  • To display the top part of a file do:

    $ head /var/adm/messages
    

    To display the first 20 lines of a file

    $ head -20 /var/adm/messages
    

    To view the top part of many files and control output displayed using more

    $ head messages* | more
    

Log in to reply
 

© Lightnetics 2024