I have a log file with thousands of lines. I want to copy certain logs ranging between two line numbers to another file so that I can share them within team.
For example - I want to copy text from line number 1000 to line 1200 to another file say issueLog.log
What is the shortest way to do this?
Note: We are not using vim.
Open the original file in
Vi and type the following command.
sed -n 1000,1200p original-file > issueLog.log
perl -ne 'print if 1000..1200' original-file > issueLog.log
awk 'NR>=1000&&NR<=1200' original-file > issueLog.log