cat:连接并显示文件
NAME
cat - concatenate files and print on the standard output
[root@localhost ~]# cat /etc/issue
Red Hat Enterprise Server release 6.6 (Santiago)
\m
[root@localhost ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sun Jun 21 02:15:00 2015
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=57d85756-7680-4c7c-9125-6ad67dae2c45 / ext4 defaults 1 1
UUID=2622a4b4-ddc9-47a3-aa2b-f06bc9bec085 /boot ext4 defaults 1 2
UUID=33d94759-fa01-4c4f-b4ac-bf3a1fe5e84f swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
[root@localhost ~]# cat /etc/issue /etc/fstab
Red Hat Enterprise Server release 6.6 (Santiago)
\m
#
# /etc/fstab
# Created by anaconda on Sun Jun 21 02:15:00 2015
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=57d85756-7680-4c7c-9125-6ad67dae2c45 / ext4 defaults 1 1
UUID=2622a4b4-ddc9-47a3-aa2b-f06bc9bec085 /boot ext4 defaults 1 2
UUID=33d94759-fa01-4c4f-b4ac-bf3a1fe5e84f swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
[root@localhost ~]#
-n, --number(显示行号)
number all output lines
[root@localhost ~]# cat -n /etc/issue
1 Red Hat Enterprise Server release 6.6 (Santiago)
2 \m
3
-E, --show-ends(显示结束符号$,windows结束符为$+回车)
display $ at end of each line
[root@localhost ~]# cat -E /etc/issue
Red Hat Enterprise Server release 6.6 (Santiago)$
\m$
$
tac:倒叙显示文本
NAME
tac - concatenate and print files in reverse
[root@localhost ~]# cat /etc/issue
Red Hat Enterprise Server release 6.6 (Santiago)
\m
[root@localhost ~]# tac /etc/issue
\m
Red Hat Enterprise Server release 6.6 (Santiago)
more、less:分屏查看
more支持向后翻屏,翻到文章尾部后退出
less不会退出
head:输出文件首部
NAME
head - output the first part of files
[root@localhost ~]# head /etc/inittab
# inittab is only used by upstart for the default runlevel.
#
# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# System initialization is started by /etc/init/rcS.conf
#
# Individual runlevels are started by /etc/init/rc.conf
#
# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf
#
tail:输出文件尾部
NAME
tail - output the last part of files
[root@localhost ~]# tail /etc/inittab
# Default runlevel. The runlevels used are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
#
id:5:initdefault:
[root@localhost ~]#
-f, --follow[={name|descriptor}] (查看文件尾部后续追加内容)
output appended data as the file grows; -f, --follow, and --follow=descriptor are
equivalent