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

后端 未结 2 467
[愿得一人]
[愿得一人] 2020-12-19 00:36

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

相关标签:
2条回答
  • 2020-12-19 01:07

    Did you try the man page for head?

    head -n 10 filename
    
    0 讨论(0)
  • 2020-12-19 01:11

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

    sed 10q path
    

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

    0 讨论(0)
提交回复
热议问题