Linux中head使用方法

119 阅读1分钟

head使用方法

head:查看文件头10行

[root@yang-1 ~]# head anaconda-ks.cfg.1 
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
cdrom
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda

head -n:指定文件头行号

[root@yang-1 ~]# head -n 2 anaconda-ks.cfg.1 
#version=DEVEL
# System authorization information
[root@yang-1 ~]#