This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14941|Reply: 0

[linux] Linux less command explained in detail

[Copy link]
Posted on 4/12/2018 11:21:13 AM | | | |
1. Introduction



The less tool is also a tool for pagination display of files or other outputs, and it should be said that it is a tool for viewing file content in Linux orthodoxy, which is extremely powerful. less can have more search functions, not only down but also up. And less doesn't load the entire file until it's viewed.

2. Command format

less [parameter] file

3. Command parameters


-b <缓冲区大小> Set the size of the buffer

-e Automatically leave when the file is finished displaying

-g only marks the last searched keyword

-f Force open special files such as peripheral codenames, directories, and binaries

-i Ignore case when searching

-m shows a percentage similar to the more command

-N Displays the line number for each line

-o <文件名> Save the content of the less output in the specified file
-Q No warning tone

-s Displays a line of consecutive empty lines

-S will discard the excess if it is too long

-x <数字> Displays the "tab" key as a specified numeric space

4. Common operations

/字符串:向下搜索“字符串”的功能

String: The ability to search up for "string"

n: Repeat the previous search (with / or ?) Related)

b Turn one page back

d Turn back half a page

h Show the help interface

Q Quit less command

u Scroll forward half a page

y Scroll one line forward

Spacebar to scroll a page

Enter scroll a line

[pagedown]: Scroll down one page

[pageup]: Flip a page up

For Linux novices, they often encounter some simple problems, such as using the less command to view the file, stuck in END, unable to come out,

At this time, you only need to press q.





Previous:How can I find MB quickly
Next:Unable to provide a process for a ADO.NET with the fixed name "System.Data.SqlClient"...
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com