UNIX - 头和文件尾 [英] unix - head AND tail of file
本文介绍了UNIX - 头和文件尾的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设你有一个txt文件,什么是查看前10行和底部10行文件的命令同时?
Say you have a txt file, what is the command to view the top 10 lines and bottom 10 lines of file simultaneously?
即。如果该文件是200线长,然后一气呵成查看线1-10和190-200。
i.e. if the file is 200 lines long, then view lines 1-10 and 190-200 in one go.
推荐答案
您可以简单:
(head; tail) < file.txt
这篇关于UNIX - 头和文件尾的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文