$ ls -l total 310M -rw-rw-r-- 1 user user 10M Mar 21 20:01 a drwxrwxr-x 2 user user 22 Mar 21 20:01 aa -rw-rw-r-- 1 user user 100M Mar 21 20:01 b -rw-rw-r-- 1 user user 200M Mar 21 20:01 c
$ ls -l total 310M -rw-rw-r-- 1 user user 10M Mar 21 20:01 a drwxrwxr-x 2 user user 22 Mar 21 20:01 aa -rw-rw-r-- 1 user user 100M Mar 21 20:01 b -rw-rw-r-- 1 user user 200M Mar 21 20:01 c
$ ls -l total 310M -rw-rw-r-- 1 user user 10M Mar 21 20:01 a drwxrwxr-x 2 user user 22 Mar 21 20:01 aa -rw-rw-r-- 1 user user 100M Mar 21 20:01 b -rw-rw-r-- 1 user user 200M Mar 21 20:01 c
If the file is longer than the size of Terminal window then it will be not easy to read or view all the content of the file easily. But there is a tweak, you can use less with cat command. It will give user an ability to scroll forward and backward through the content of the files using PgUp and PgDn keys or Up and Down Arrow keys on the keyboard.
auditd 48/udp # Digital Audit Daemon la-maint 51/tcp # IMP Logical Address Maintenance la-maint 51/udp # IMP Logical Address Maintenance xns-time 52/tcp # XNS Time Protocol xns-time 52/udp # XNS Time Protocol xns-ch 54/tcp # XNS Clearinghouse xns-ch 54/udp # XNS Clearinghouse isi-gl 55/tcp # ISI Graphics Language isi-gl 55/udp # ISI Graphics Language xns-auth 56/tcp # XNS Authentication xns-auth 56/udp # XNS Authentication xns-mail 58/tcp # XNS Mail xns-mail 58/udp # XNS Mail ni-mail 61/tcp # NI MAIL ni-mail 61/udp # NI MAIL 5%
此时可以在左下角看到,有个百分比。
-N 显示行号
使用-N可以实现cat中-n的效果,显示行号
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
$ less -N /etc/services 1 # /etc/services: 2 # $Id: services,v 1.55 2013/04/14 ovasik Exp $ 3 # 4 # Network services, Internet style 5 # IANA services version: last updated 2013-04-10 6 # 7 # Note that it is presently the policy of IANA to assign a single well-known 8 # port number for both TCP and UDP; hence, most entries here have two entries 9 # even if the protocol doesn't support UDP operations. 10 # Updated from RFC 1700, ``Assigned Numbers'' (October 1994). Not all ports 11 # are included, only the more common ones. 12 # 13 # The latest IANA port assignments can be gotten from 14 # http://www.iana.org/assignments/port-numbers 15 # The Well Known Ports are those from 0 through 1023. 16 # The Registered Ports are those from 1024 through 49151