W walla Senior member Jun 2, 2001 987 0 0 Apr 3, 2005 #1 In unix, what command can I use to display lines n to m of a file. For instance, given the file test.txt, what command and syntax do I use to print lines 150 to 300 (and assume the last line is greater than 300). Thanks.
In unix, what command can I use to display lines n to m of a file. For instance, given the file test.txt, what command and syntax do I use to print lines 150 to 300 (and assume the last line is greater than 300). Thanks.
cleverhandle Diamond Member Dec 17, 2001 3,566 3 81 Apr 3, 2005 #2 I'm not sure if this is the simplest way, but you can use sed with something like... cat test.txt | sed -n 150,300p
I'm not sure if this is the simplest way, but you can use sed with something like... cat test.txt | sed -n 150,300p
C CTho9305 Elite Member Jul 26, 2000 9,214 1 81 Apr 3, 2005 #3 ugly hack? cat test.txt |head -n 300 |tail -n 150