Filter certain lines from a file in Linux

Home > Search

The awk command can be used to filter certain lines in a file. For example, the following command will only display line 5 in example.txt.

awk 'NR==5' example.txt


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter in the box below so that we can be sure you are a human.