G Giao Linh New member Jan 12, 2022 #1 How do I select a specific line in a file in Unix? Answer To extract a range of lines, say lines 2 to 4, you can execute either of the following: $ sed -n 2,4p somefile. txt. $ sed ‘2,4! d’ somefile. txt.
How do I select a specific line in a file in Unix? Answer To extract a range of lines, say lines 2 to 4, you can execute either of the following: $ sed -n 2,4p somefile. txt. $ sed ‘2,4! d’ somefile. txt.