Linux命令--head(查看文件头部内容)

原文网址:Linux命令--head(查看文件头部内容)_IT利刃出鞘的博客-CSDN博客

简介

        本文介绍Linux的head命令的用法。

        head用于查看文件的最开头的内容。

参数

-q 隐藏文件名
-v 显示文件名
-c 显示前多少个字节数
-n 显示前几行

示例

1.显示文件的前5行

head -n 5 test.txt

2.显示文件前5个字节

head -c 5 test.txt

3.显示除了最后5个字节以外的内容

head -c -5 test.txt

猜你喜欢

转载自blog.csdn.net/feiying0canglang/article/details/125569550