每天回顾linux命令(head)

head命令
head命令用于显示文件的开头的内容。在默认情况下,head命令显示文件的头10行内容。

语法
head (选项) (参数)

选项
-n number :指定显示头部内容的行数。

root@68fc0a9bc6dd:/home/wzm/testtail# head redis.conf -n 3
# Redis configuration file example.
#
# Note that in order to read the configuration file, Redis must be

-c number:指定显示头部的字符数。

root@68fc0a9bc6dd:/home/wzm/testtail# head redis.conf -c 10
# Redis coroot@68fc0a9bc6dd:/home/wzm/testtail#

-q:不显示文件名

root@68fc0a9bc6dd:/home/wzm/testtail# head -n 3 -q redis.conf README.md
# Redis configuration file example.
#
# Note that in order to read the configuration file, Redis must be
This README is just a fast *quick start* document. You can find more detailed documentation at http://redis.io.

What is Redis?

-v:总是显示文件名的头信息,默认

root@68fc0a9bc6dd:/home/wzm/testtail# head -n 3 -v redis.conf README.md
==> redis.conf <==
# Redis configuration file example.
#
# Note that in order to read the configuration file, Redis must be

==> README.md <==
This README is just a fast *quick start* document. You can find more detailed documentation at http://redis.io.

What is Redis?
root@68fc0a9bc6dd:/home/wzm/testtail#

参数
文件列表:指定显示头部内容的文件列表。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值