创建一个测试文件 seq 100 > seq.txt
法1 head -30 seq.txt|tail -11
法2 sed -n '20,30p' seq.txt (必会)
法3 awk '{if(NR>19&&NR<31) print $0}' seq.txt
法4 awk 'NR>19 && NR<31' seq.txt
法5 grep 20 -A 10 ett.txt grep 25 -C 5 ett.txt grep 30 -B 10 ett.txt
创建一个测试文件 seq 100 > seq.txt
法1 head -30 seq.txt|tail -11
法2 sed -n '20,30p' seq.txt (必会)
法3 awk '{if(NR>19&&NR<31) print $0}' seq.txt
法4 awk 'NR>19 && NR<31' seq.txt
法5 grep 20 -A 10 ett.txt grep 25 -C 5 ett.txt grep 30 -B 10 ett.txt