grep -n 读取指定行 sed -n '18p' data.txt sed -n '开始行,结束行p' data.txt;显示文件X行到Y行的内容: 命令:sed -n '10,18p' data.txt