How do I count the number of lines in a file?



  • To count the number of lines in a file do:

    $ wc -l /etc/inetd.conf
    

    To count the number of lines in the output of ls -l of a directory

    $ ls -l /var/tmp
    

Log in to reply
 

© Lightnetics 2024