How to Find the Number of Lines in a File for Unixby Kristen Waters
Configuration files, scripts and system logs are all kept in plain text files in the Unix and Linux operating systems. These files can grow quickly. If you want to know how many lines are in a Unix text file, use the "wc" command. This command shows the number of words, lines and characters are in a particular file. Determine the number of lines by counting the newline -- "\n" -- characters in a particular file.
Open a terminal window or log into an SSH session to access a command prompt.
Type the command "wc -l filename" to show the number of lines in the file. Replace "filename" with the exact name of the file.
Press the "Enter" key to display the information on the next line.