How do I read the first line of a file using cat?

前端 未结 11 796
渐次进展
渐次进展 2021-01-29 22:20

How do I read the first line of a file using cat?

11条回答
  •  遇见更好的自我
    2021-01-29 22:38

    This may not be possible with cat. Is there a reason you have to use cat?

    If you simply need to do it with a bash command, this should work for you:

    head -n 1 file.txt
    

提交回复
热议问题