Linux less命令:回卷显示文本文件
Linux less命令 功能描述
使用less命令可以回卷显示文本文件的内容。less命令的作用与more十分相似,都可以用来浏览文本文件的内容,不同的是less命令允许使用者往回卷动。
Linux less命令 语法
less [选项] [文件]
命令中各选项的含义如表所示。
在使用less命令时,可以使用表所示的子命令。
Linux less命令 示例
回卷显示/etc/services文件的内容
[root@rhel ~]# less /etc/services
# /etc/services:
# Id: services, v 1.482009/11/11 14:32:31 ovasik Exp
#
# Network services, Internet style
# IANA services version: last updated 2009-11-10
#
# Note that it is presently the policy of IANA to assign a single well-known
# port number for both TCP and UDP; hence, most entries here have two entries
# even if the protocol doesn't support UDP operations.
#Updated from RFC 1700, ''Assigned Numbers''(October 1994). Not all ports
# are included, only the more common ones.
#
# The latest IANA port assignments can be gotten from
# http://www.iana.org/assignments/port-numbers
# The Well Known Ports are those from 0 through 1023.
# The Registered Ports are those from 1024 through 49151
# The Dynamic and/or Private Ports are those from 49152 through 65535
#
# Each line describes one service, and is of the form:
#
#service-name port/protocol [aliases...] [#comment]
tcpmux 1/tcp #TCP port service multiplexer
tcpmux 1/udp #TCP port service multiplexer
rje 5/tcp #Remote Job Entry
rje 5/udp #Remote Job Entry
echo 7/tcp
echo 7/udp
discard 9/tcp sink null
discard 9/udp sink null
systat 11/tcp users
systat 11/udp users
daytime 13/tcp
daytime 13/udp
qotd 17/tcp quote
qotd 17/udp quote
msp 18/tcp #message send protocol
msp 18/udp #message send protocol
/etc/services