How to View File Content in linux

Source: Internet
Author: User
How to View File Content in linux-Linux general technology-Linux technology and application information. Several commands for viewing File Content in linux are as follows:

Cat: displays all contents of the file starting from the first line;

Tac: displays all the contents of the file starting from the last line. Note that the tac and cat statements are the opposite;

Cat [-n] File Name

-N: The line numbers are displayed on the screen together.

Tac file name

More: displays the file content on one page. You can only flip the page backward;

Less: The file content is displayed on one page. However, you can use pagedown on the keyboard and pageup to control the page backward and flip the page forward;

More file name

Less file name

In the less open file, enter:

"/Word" searches for the word string in the file;

Q: exit the less image;

Head: displays the first few lines of a file;

Tail: displays the last few lines of a file;

Head [-n number]

Tail [-n number]

Number: the number of rows displayed;

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.