操做: cat file1
快捷查看當前文件的內容java
[root@localhost ~]# cat initial-setup-ks.cfg #version=RHEL7 # X Window System configuration information xconfig --startxonboot # License agreement eula --agreed # System authorization information auth --enableshadow --passalgo=sha512 # Use CDROM installation media cdrom # Run the Setup Agent on first boot firstboot --enable
分頁顯示文件內容
操做: more file1
Enter :向下n行,默認1行
空格鍵:向下滾動一屏 或 Ctrl + F
B:返回上一屏 或 Ctrl + B
q:退出moreredis
[root@localhost ~]# more initial-setup-ks.cfg #version=RHEL7 # X Window System configuration information xconfig --startxonboot # License agreement eula --agreed # System authorization information auth --enableshadow --passalgo=sha512 # Use CDROM installation media cdrom # Run the Setup Agent on first boot firstboot --enable # System services services --enabled="chronyd" # Keyboard layouts keyboard --vckeymap=us --xlayouts='us' # System language lang en_US.UTF-8 ignoredisk --only-use=sda # Network information network --bootproto=dhcp --device=eno16777736 --ipv6=auto --activate network --bootproto=dhcp --hostname=localhost.localdomain --More--(50%)
分頁顯示文件內容,並標註行號
操做: less -mN file1
快捷鍵同 more命令bash
[root@localhost ~]# less -mN initial-setup-ks.cfg 1 #version=RHEL7 2 # X Window System configuration information 3 xconfig --startxonboot 4 5 # License agreement 6 eula --agreed 7 # System authorization information 8 auth --enableshadow --passalgo=sha512 9 # Use CDROM installation media 10 cdrom 11 # Run the Setup Agent on first boot 12 firstboot --enable
能夠快速查看文件後x行的內容
操做: tail -10 file1less
[root@localhost ~]# tail -10 initial-setup-ks.cfg @internet-browser @java-platform @multimedia @network-file-system-client @print-client @x11 chrony %end