场景是我有一个文件并包含一个字符串“日期和时间是 2012-12-07 17:11:50”
我已经搜索并找到了一个命令
grep 'the date and time is' 2012-12-07.txt | cut -d\ -f5
它只显示第 5 个单词,我需要第 5 个和第 6 个的组合,所以我尝试了
grep 'the date and time is' 2012-12-07.txt | cut -d\ -f5 -f6
但它的错误。
现在,如何用一个命令 grep 第 5 个和第 6 个单词
我只需要像 2012-12-07 17:11:50
这样的输出
最佳答案
关于linux - 找到模式后 Grep for 2 words,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13762783/