How to get line numbers in file through cat command

Cat command can be used for many purposes. But do you also know you can see the line numbers in files with the help of cat command. With this method it is easy to troubleshoot or this information is also useful while creating the bash script.

Use the given below command

With cat command use -n flag


cat -n filename

Below is the screenshot of example.

cat-command

Read Some More Articles

2 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.