Linux file content viewing command-less

Source: Internet
Author: User
Tags call shell
The Linux file content display command-lessless is also a tool that displays files or other outputs by page. it should be said that it is a tool for linux Orthodox file content viewing and has extremely powerful functions. for beginners, we recommend that you use less. Because there are too many less content, the following is the most common introduction; l... the Linux file content viewing command-less tool is also a tool for paging display of files or other outputs. it should be said that it is a tool for linux Orthodox viewing file content and has extremely powerful functions. for beginners, we recommend that you use less. Because there is too much less content, the following is the most common introduction; less syntax format; less [Parameters] file common parameters-c from top (top to bottom) refresh the screen, and display the file content. Instead of refreshing by scrolling at the bottom.-f forces the file to be opened. no warning is prompted when the binary file is displayed.-I case is ignored when searching, unless the search string contains uppercase letters; -I case-insensitive during search, unless the search string contains lower-case letters;-m indicates the percentage of files read;-M indicates the percentage of files read, row number, and total number of rows; -N: output the row number before each row;-p pattern: Search for pattern; for example, search for the word MAIL in/etc/profile, use less-p MAIL/etc/profile-s to display multiple blank rows as one blank line;-Q does not ring the bell under the terminal; for example: when we display the/etc/profile content, let it display the row number; [root @ localhost ~] # Less-N/etc/profile: for example, when we check the log line or content of a day, [root @ localhost ~] # Less-Mp '2017-08-08 '/var/log/dpkg. log less action commands; after entering less, we have to learn several actions to make it easier for us to view the file content; the most important command to remember is q, which can cause less to terminate viewing the file and exit; action: Enter the Enter key to move one line down; y to move one line up; space key to scroll down one screen; B to scroll up one screen; d to scroll down half screen; h less help; u to the Ocean Motion half screen; w can specify the row to be displayed, starting from the next row of the specified number; for example, if it is set to 6, it will be displayed from the second row; g to the first line; G to the last line; p n % to n %, for example, 10%, that is, it is displayed later than 10% of the entire file content;/pattern search pattern, for example,/MAIL indicates searching for MAIL words in the file; v calls vi editor; q exits less! Command to call SHELL, you can run commands; for example! Ls displays all files in the current directory of the current column.-EOF-
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.