显示文件oldboy.txt的第20行到30行请问如何做?
echo stu{00..40}|xargs -n1 >oldboy.txt
1. head -30 oldboy.txt|tail -11 2. sed -n ‘20,30p‘ oldboy.txt 3. sed -n ‘20,30!d‘ oldboy.txt 4. awk ‘NR==20,NR==30‘ oldboy.txt 5. awk ‘NR>=20 && NR<=30‘ oldboy.txt 6. grep -n "" oldboy.txt |grep -A 10 "^20:" 7. grep -n "" oldboy.txt |grep -B 10 "^30:" 8. grep -n "" oldboy.txt |grep -C 5 "^25:"
备注
今天是每日一题陪伴大家的第125天,期待你的进步。
对于题目和答案的任何疑问,请在博客评论区留言。
往期题目索引
http://lidao.blog.51cto.com/3388056/1914205
时间: 2024-10-09 03:12:43