Linux Common Commands-view text/cat,tac,more,less,head,tail

Source: Internet
Author: User
Tags uuid

Cat: Connect and display files

NAME
cat-concatenate files and print on the standard output


[Email protected] ~]# cat/etc/issue
Red Hat Enterprise Server Release 6.6 (Santiago)
\m


[Email protected] ~]# Cat/etc/fstab


#
#/etc/fstab
# Created by Anaconda on Sun June 21 02:15:00 2015
#
# Accessible filesystems, by reference, is maintained under '/dev/disk '
# See mans 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
[Email protected] ~]# Cat/etc/issue/etc/fstab
Red Hat Enterprise Server Release 6.6 (Santiago)
\m



#
#/etc/fstab
# Created by Anaconda on Sun June 21 02:15:00 2015
#
# Accessible filesystems, by reference, is maintained under '/dev/disk '
# See mans 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
[Email protected] ~]#



-N,--number (show line number)
Number all output lines

[Email protected] ~]# cat-n/etc/issue
1 Red Hat Enterprise Server Release 6.6 (Santiago)
2 \m
3


-E,--show-ends (display end symbol $,windows Terminator is $+ carriage return)
Display $ at end of each line

[Email protected] ~]# cat-e/etc/issue
Red Hat Enterprise Server Release 6.6 (Santiago) $
\m$
$

TAC: Flashback display text

NAME
Tac-concatenate and print files in reverse


[Email protected] ~]# cat/etc/issue
Red Hat Enterprise Server Release 6.6 (Santiago)
\m


[Email protected] ~]# tac/etc/issue


\m
Red Hat Enterprise Server Release 6.6 (Santiago)


More, Less: Split screen view

More support to turn back the screen, turn to the end of the article and exit

Less does not quit

Head: Output file header

NAME
Head-output the first part of the files

[Email protected] ~]# Head/etc/inittab
# Inittab is a used by upstart for the default runlevel.
#
# ADDING Other CONFIGURATION here would have NO EFFECT on YOUR SYSTEM.
#
# System initialization is started by/etc/init/rcs.conf
#
# individual runlevels is started by/etc/init/rc.conf
#
# Ctrl-alt-delete is handled by/etc/init/control-alt-delete.conf
#

Tail: Output File Trailer

NAME
Tail-output the last part of the files

[Email protected] ~]# Tail/etc/inittab
# Default RunLevel. The runlevels used is:
# 0-halt (do not set Initdefault to this)
# 1-single User mode
# 2-multiuser, without NFS (the same as 3, if you don't have networking)
# 3-full Multiuser mode
# 4-unused
# 5-x11
# 6-reboot (do not set Initdefault to this)
#
Id:5:initdefault:
[Email protected] ~]#


-F,--follow[={name|descriptor}] (view trailing append of file)

Output appended data as the file grows; -F,--follow, and--follow=descriptor are
Equivalent


Linux Common Commands-view text/cat,tac,more,less,head,tail

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.