Find Single Line from File in UNIX & Linux

Symptom

You are getting error on which referring to a file that popping up message like below. It’s gonna be really troublesome for you to count one by one from the first line until you get to the needed line.

error login : at /home/itsiti/ara.sh line 100

Solution

As an example, the error occurred on line 100 from file ara.sh. You can execute below command to directly jump to the line.

head -n 100 ara.sh | tail -n 1

You May Also Like

Leave a Reply?