Output specific line huge text file Output specific line huge text file bash bash

Output specific line huge text file


You could use sed -n -e 123456p your.dump to print line 123456


If the file is long, consider using

sed -n 'X{p;q}' file

Where X is the line number. It will stop reading the file after reaching that line.


If sed is too slow for your taste you may also use

cat $THE_FILE | head -n $DESIRED_LINE | tail -n 1