如何在指定的行号后grep字符串? [英] How to grep a string after a specified line number?

查看:23
本文介绍了如何在指定的行号后grep字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很大的文本文件,我想在这个文本文件中看到包含花费的时间"的行,我使用:

I have a large text file, I want to see the lines containing "time spent" in this text file, I use:

grep -in "time spent" myfile.txt

但我只对 50000 之后的行感兴趣.在输出中,我想看到 50000 之后的行并且包含花费的时间".有没有办法做到这一点?

But I'm interested only in the lines after 50000. In the output I want to see lines after 50000 and that contain "time spent". Is there a way to do this?

推荐答案

你可以拖尾,然后 grep:

You can tail it, then grep:

tail -n +50000 myfile.txt | grep -in "time spent"

这篇关于如何在指定的行号后grep字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆