Linux File Management Less

Source: Internet
Author: User

Less more than more command English intent
    • Less
Command format
    • less [参数] 文件
Command function
    • The less tool is also a tool for paging through files or other output, which is a very powerful tool for Linux to view the contents of a file. The usage of less is more resilient than more. In more, we have no way to turn front, can only look back, but if use less, you can use [Pageup][pagedown] and other key functions to go to look at the file, more easily used to view the contents of a file! In addition, in less you can have more search function, not only to search down, but also to search upward.
Common parameters
    • -B buffer size > Set buffer size

      -E When the file is displayed, automatically leave

      -f forcing special files to open, such as peripheral code, directories, and binaries

      -G only flags the last keyword to search

      -I ignore search case

      -M show percentages similar to more commands

      -n display line numbers per line

      -o filename > Save the less output in the specified file < /p>

      -Q do not use a warning tone

      -S show continuous empty line

      -S line too long will be out of the partial discard

      -X number > To display the TAB key as a specified number space

      /String : Search down the function of "string"

      ? string : Search Up "string" function

      n : Repeat previous search (with/or?)

      n : Reverse Duplicate previous search (with/or?)

      b Turn back page

      D turn half page back

      H Display Help interface

      Q exit less command

      u forward scroll half page

      y scrolls forward one line

      spacebar scrolling a line

      enter scroll a page

      [PageDown] : Scroll down one page

      [PageUp] : Flipping up one page

Common Example Example 1

PS View process information and display with less pagingps -ef | less

Example 2

View command history usage records and display with less paging

Example 3

Browse Multiple Files

Common commands
    1. Full Screen navigation

      ctrl + F - 向前移动一屏

      ctrl + B - 向后移动一屏

      ctrl + D - 向前移动半屏

      ctrl + U - 向后移动半屏

    2. Single-line navigation

      j - 向前移动一行

      k - 向后移动一行

    3. Other navigation

      G - 移动到最后一行

      g - 移动到第一行

      q / ZZ - 退出 less 命令

    4. Other useful commands

      v - 使用配置的编辑器编辑当前文件

      h - 显示 less 的帮助文档

      &pattern - 仅显示匹配模式的行,而不是整个文件

    5. Tag Navigation

      When you use less to view large files, you can mark them in any one place, and you can navigate to the text location labeled with a specific tag by command:

      ma - 使用 a 标记文本的当前位置

      a - 导航到标记 a 处

Linux file Management less

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.