使用SED获取巨大文本文件的最后n行 [英] Using SED to Get the Last n Lines of a Huge Text File
本文介绍了使用SED获取巨大文本文件的最后n行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用"sed"命令获取巨大文本文件(例如A.txt)的最后n行并将其复制到新的文本文件(例如B.txt)中?我不想从A.txt中删除这些行.
How can I use "sed" command to get the last n lines of a huge text file (e.g. A.txt) and copy them into a new text file(e.g. B.txt)? I do not want to remove that lines from A.txt.
推荐答案
您没有.为此,您使用 tail -n NUMLINES
.
You don't. You use tail -n NUMLINES
for that.
tail -n 100 A.txt > B.txt
这篇关于使用SED获取巨大文本文件的最后n行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文