up vote 1 down vote favorite
1
share [g+] share [fb]

What is the best way to output from a file starting from a specific line (big number like 70000). Something like:

cat --line=70000 <file>
link|improve this question

73% accept rate
feedback

3 Answers

up vote 7 down vote accepted

Take a look at tail, more precisecly, it's --lines=+N switch:

tail --lines=+100 <file>
link|improve this answer
Wow. I didn't know this even after using this on linux for 8 years ! I always used a bash fn ! Thanks ! getFromLine () { lineno=wc -l $1 | awk '{print $1}' ; lineno=expr $lineno - $2 ; tail -n $lineno $1 ; } – secureBadshah Oct 30 '09 at 8:53
feedback

The most obvious way is tail, the syntax might be slightly different depending on what OS you are using:

tail -n +70000

If you can not get tail to work, you could use sed, but it might end up slower.

sed -pe '1,69999d'
link|improve this answer
feedback

tail +250

more about unix cat command

link|improve this answer
fascinating link, but it doesn't really give any information that applies to this question, and your tail suggestion is the same as the accepted and other answers from weeks ago. why bother to post? – quack quixote Nov 18 '09 at 5:48
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.