Linux commands for viewing the contents of a file

Source: Internet
Author: User

All we mentioned just now is to show the appearance of the file, or to move and copy a file or directory, so what if we want to inspect the contents of an archive?! There are quite a few interesting instructions to share: the most commonly used instructions for displaying the contents of a file can be said to be cat and more and less! Also, if we want to look at a very large file (hundreds of MB), but we only need a few lines back-end, then what is the good? Oh! With tail ah, in addition, TAC This command can also be achieved! All right, let's talk about the purpose of each instruction!

Cat starts displaying the contents of the archive from the first line
The TAC is displayed backwards from the last line, and you can see that the TAC is the backward write of cat!
More page-by-page display of archive content
Less is similar to more, but better than more, he can page forward!
Head's just a few lines.
Tail only look at the tail a few lines
NL display, the output line number!
OD reads the contents of the file in binary mode!

Linux commands for viewing the contents of a file

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.