【问题标题】:How to select rest of a file excluding some lines in linux?如何选择文件的其余部分,不包括 linux 中的某些行?
【发布时间】:2018-01-05 03:08:57
【问题描述】:

我需要与类似问题(Selecting a part of a file and copying that into new file in Linux)的答案(sed -n '200,700p' logfilename > destinationFilename)相反的东西。我需要排除一些行,例如从 200 到 700 并输出文件的其余部分,以便我可以将其复制到另一个文件。我该怎么做?

【问题讨论】:

    标签: linux text sed


    【解决方案1】:

    你会使用 sed '200,700d' 日志文件名 > 目标文件名

    参考:https://unix.stackexchange.com/questions/11204/how-do-i-remove-certain-lines-using-line-numbers-in-a-file

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-26
      • 2021-04-18
      • 2016-07-04
      • 2020-10-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-13
      相关资源
      最近更新 更多