Linux File View command

Source: Internet
Author: User

File View

The more function is to start the file from the first line, according to the Output window size, the appropriate output file content. When a page cannot be fully output, you can use "enter" to turn down the line, with the "SPACEBAR" to page down. To exit the view page, press the "Q" key. In addition, more can be combined with the pipe symbol "|" (pipe), for example: Ls-al | More

More syntax: more file names

Enter down n rows, need to be defined, default to 1 rows;

Ctrl F scrolls down one screen;

The space bar scrolls down one screen;

Ctrl-B returns to the previous screen;

= Output the line number of the current line;

: F output File name and line number of the current line;

V Call VI Editor;

! command to invoke the shell and execute the command;

Q Exit More


Less has the same function as more, but using more can not page forward, only backward.

Less can use "PageUp" and "PageDown" keys to page ahead

Less syntax: less file name

Less has a feature that you can search for in the file you want, assuming you want to find in the passwd file there is no WebLogic string, then you can do this:

[email protected] etc]# less passwd

Then enter:

/weblogic

Enter

At this point, if there is a WebLogic string, Linux displays the character in a highlighted manner.

To exit the view page, press the "Q" key.


Head and tail

Head and tail are typically used in cases where only the first few lines or the last few lines of the file need to be read.

The head function is to display the first few lines of the file
Head-4 a.txt Display first 4 lines of content
Tail functions just as opposed to head, showing only the last few lines of content
Tail-5 b.txt display after 5 lines of content

[Email protected] ~]# head-5 install.loginstalling libgcc-4.4.7-16.el6.x86_64warning:libgcc-4.4.7-16.el6.x86_64: Header V3 rsa/sha1 Signature, key ID c105b9de:nokeyinstalling setup-2.8.14-20.el6_4.1.noarchinstalling filesystem-2.4.30-3.el6.x86_64installing Basesystem-10.0-4.el6.noarch[[email protected] ~]# tail-5 Install.loginstalling ipw2100-firmware-1.3-11.el6.noarchinstalling Ql23xx-firmware-3.03.27-3.1.el6.noarchinstalling ipw2200-firmware-3.1-4.el6.noarchinstalling rootfiles-8.1-6.1.el6.noarch*** finished installing PACKAGES ***[[email protected] ~]#


This article is from the "Technical Achievement Dream" blog, please be sure to keep this source http://xuxiaoliang.blog.51cto.com/10882951/1922146

Linux File View command

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.