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

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

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

11条回答
  •  心在旅途
    2021-01-29 22:46

    You could use cat file.txt | head -1, but it would probably be better to use head directly, as in head -1 file.txt.

提交回复
热议问题