Tuesday, December 17, 2024
HomeUNIXView a File with Line Numbers

View a File with Line Numbers

Using the cat command in UNIX, a file can be displayed with the line number of each line preceding the line.

Here is an example of displaying the file filename with line numbers:

cat -n filename

Quinn McHenry
Quinn McHenry
Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

LATEST REVIEWS

Recent Comments

error: Content is protected !!