How can I view only the first n lines of the file?

巧了我就是萌 提交于 2019-11-30 09:00:54

问题


I tried head +10 and it didn't work.


回答1:


Did you try the manpage for head?

head -n 10 filename




回答2:


Head is a fine tool, but you might also try:

sed 10q path

For code golf fanatics, sed is always better than head :)



来源:https://stackoverflow.com/questions/1411070/how-can-i-view-only-the-first-n-lines-of-the-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!