1 提取开头的n行
用head awk或者 sed实现
head -n 1 do.txt
sed 1q do.txt
awk 'FNR <= 1' do.txt
do.txt文件
2 显示行尾的几行
用tail -n file
tail -1 do.txt