美文网首页
浏览文件类命令_CentOS 7

浏览文件类命令_CentOS 7

作者: 082e63dc752b | 来源:发表于2021-03-16 00:47 被阅读0次

1. cat

一次性显示文件内容

[root@localhost ~]# cat anaconda-ks.cfg 
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
cdrom

2. more

分屏显示文件内容,按空格键下翻一屏,回车键下移一行,直到显示完全部内容后自动退出。

[root@localhost ~]# more anaconda-ks.cfg 
#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
# Keyboard layouts
keyboard --vckeymap=cn --xlayouts='cn'
--More--(18%)

3. less

more的升级版。可以上下左右移动,可以上下翻屏,可以搜索。按“q”键退出

[root@localhost ~]# less anaconda-ks.cfg 

#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
cdrom
# Use graphical install
:

4. head

显示文件的开头部分,默认显示后10行,

  • -n num 指定显示文件的前num行
  • -c num 指定显示文件的前num个字符
[root@localhost ~]# head anaconda-ks.cfg 
#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

5. tail

显示文件的末尾部分,默认显示后10行,

  • -n num 指定显示文件的后num行
  • -c num 指定显示文件的后num个字符
[root@localhost ~]# tail anaconda-ks.cfg 

%addon com_redhat_kdump --enable --reserve-mb='auto'

%end

%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end

相关文章

网友评论

      本文标题:浏览文件类命令_CentOS 7

      本文链接:https://www.haomeiwen.com/subject/qjhrcltx.html