Easy Tutorial
❮ Linux Comm Free Linux Comm Mkfs Ext2 ❯

Linux less Command

Linux Command Manual

less is similar to more, but it allows for arbitrary browsing of files, supports paging and searching, and allows for both forward and backward paging.

Syntax

less [options] file

Parameter Description:

Examples

  1. View a file

    less log2013.log
    
  2. Display process information with ps and paginate with less

    ps -ef | less
    
  3. View command history and paginate with less

    [root@localhost test]# history | less
    22  scp -r tomcat6.0.32 root@192.168.120.203:/opt/soft
    23  cd ..
    24  scp -r web root@192.168.120.203:/opt/
    25  cd soft
    26  ls
    ……omitted……
    
  4. Browse multiple files

    less log2013.log log2014.log
    

Additional Notes

  1. Full-screen navigation
  1. Single-line navigation
  1. Other navigation
  1. Other useful commands
  1. Mark navigation

When viewing large files with less, you can mark any position and navigate to the marked text position with commands:

Linux Command Manual

❮ Linux Comm Free Linux Comm Mkfs Ext2 ❯