常用Linux命令:sed
1.
取出文本中指定行[m, n]之间的内容:
sed -n 'm, np' filename
Sample 1:
已知:
[jiang@eb50 ~]$ cat info.txt
this is line1
this is line2
this is line3
this is line4
this is line5
this is line6
this is line7
this is line8
想要取出[5, 7]之间的内容,可以>>>
[jiang@eb50 ~]$ sed -n '5, 7p' info.txt
this is line5
this is line6
this is line7
Over。
后续慢慢添加对sed的使用。
本文介绍了如何使用Linux下的sed命令来提取指定范围内的文本行。通过一个具体的例子展示了如何从文件info.txt中提取第5行到第7行的内容。
703

被折叠的 条评论
为什么被折叠?



