How can I get some block of text by lines?
I have a log file with 6000000 lines and I want get just a block of 607366 to 700000.
I've tried something like:
head -n 607366 | tail -700000 server.log > outputFile.txt
You can use sed
:
sed -n 607366,700000p server.log > outputFile.txt
If you want to use head
and tail
, this is the right way:
head -n 700000 server.log | tail -n $(echo 700000-607366+1 | bc) > outputFile.txt
or, shorter:
head -n 700000 server.log | tail -n 92635 > outputFile.txt
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다