如何使用 cat 命令从顶部读取文件?

How do I read the file from the top using cat command?

我有一个文件 constants.php 当我 运行 这个命令时 cat constants.php 它总是向我显示文件的内容来自底端。但是我想查看文件顶部的内容,因为我的文件有超过 500 行代码。

我试过head -1 constants.php但是它只会显示第一行,这没有用,我需要从顶部看到所有内容。

有一个 head 命令。

详情在这里: https://www.linode.com/docs/tools-reference/tools/view-the-beginning-of-text-files-with-head/