The less command in Linux is mainly used to browse the contents of the file, similar to the usage of the more command. Unlike the more command, the less command can be scrolled back and viewed. Partly, let's take a look at the specific usage of the less command along with the small series.
The usage of less is more flexible than more. At more time, we have no way to turn to the front, only to look at the back, but if you use less, you can use the function of [pageup] [pagedown] and other keys to go back and look at the file, easier to use View the contents of a file! In addition, you can have more search functions in less, not only can search down, but also up.
1. Command format:
less [parameters] File
2. Command function:
less Similar to more, but use less to browse files at will, and more can only move forward, but not backwards, and less does not load the entire file before viewing.
3. Command parameters:
-b "Buffer size" Set the size of the buffer
-e When the file is displayed, leave
-f to force the special file to open. For example, peripheral code, directory, and binary files
-g only flags the last searched keyword
-i ignores case when searching
-m displays similar commands Percentage
-N Display the line number of each line
-o "File name" Save the contents of the less output in the specified file
-Q Do not use warnings Sound
-s Shows a line of continuous empty behavior
-S Lines are discarded for a long time.
-x "Number" Shows the "tab"" button as a rule Number spaces
/string: Search for the function of "string"
? String: Search for the function of "String" in string
n: Repeat the previous search (related to /or ?)
N: Repeat the previous search in reverse (with /or ? Related)
b Flip back one page
d Flip back half a page
h Display help screen
Q Exit the less command
u Scrolling half a page forward
y Scrolling one line forward
Spacebar scrolling one line
Enter key to scroll one page
[pagedown ]: Scroll down one page
[pageup]: Scroll up one page
4. Example:
Example 1: Check the file
command:
less log2013.log
Output:
Examples 2: ps view process information and display through less page
Command:
ps -ef |
Less
Output:
Previous12Next Total 2 Pages
Some users prefer to use the command line, but on the Linux system of the command l
Linux system network performance can be tested with tools. The main test tools are
pipe is a pipe in the Linux system. The main body of the pipe mechanism is the call
Learning the knowledge of character sets in Linux system can solve many system prob
Fedora boot into text mode method
Introduction to Common Disk Arrays for Linux Systems
Linux system hardware routing forwarding principle
Linux system to modify environment variables skills
The difference between Linux and Windows systems
Notes on operating online replacement files on Linux systems
What should I do if the NIC cannot be started after the Linux virtual machine is cloned?
The process of reading MBR information from Linux system
Krita software in the Linux system tutorial
How to manage modules in the Linux kernel?
Set msconfig to make Windows7 start faster one step
Windows8 network configuration error causes unable to access the Internet how to re-enable Ethernet
Win8.1 delete Hiberfil.sys file graphic tutorial
WinXP mobile hard disk prompts this disk has write protection how to solve?
Win7 changes the hard disk partition name. Step
Win7 Baidu cloud disk download speed improvement method