我有一个文件
line a - this is line a
line b - this is line b
line c - this is line c
line d - this is line d
line e - this is line e
问题是:如何使用 bash 命令输出从“line b”到“line d”的行? 我的意思是,获得:
"line b - this is line b
line c - this is line c
line d - this is line d"
最佳答案
sed -n '/line b/,/line d/p' file
关于bash - 使用 bash 读取文本文件中行的子集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1083601/