Linux Basic Command Introduction-3

Source: Internet
Author: User

Then the first two articles, the basic commands to be told today are:


Cat:concatenate, file text to view a tool. Note The format of the view file is text and you cannot cat a binary executable file and there may be an error. Let's see how it works.

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/8E/6F/wKioL1jAI5Gx8FE_AAA67UcrlU0955.png "title=" 2017-03-08_23h29_29.png "alt=" Wkiol1jai5gx8fe_aaa67ucrlu0955.png "/>

From the perspective of the effect, is actually to display the contents of the file. is not remembered on Windows, is the use of Notepad software to view the contents of a text file.


So how do you see what type of file it is? To use file This command, followed by the file name on it, to see the effect:

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/8E/6F/wKioL1jAJEvxc820AAALo5FtqJg827.png "title=" 2017-03-08_23h33_05.png "alt=" Wkiol1jajevxc820aaalo5ftqjg827.png "/>

We can see fstab this is a text file.


Another use of cat is to connect the display, that is, you can simultaneously cat multiple files to display together, to look at the effect:

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/8E/71/wKiom1jAJhCCtOIkAACBfwdFJRY668.png "title=" 2017-03-08_23h39_54.png "alt=" Wkiom1jajhcctoikaacbfwdfjry668.png "/>


In fact, there are other options for cat, let's look at:

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/8E/6F/wKioL1jAJnXwXQ3XAAB5-lb24XQ811.png "title=" 2017-03-08_23h42_12.png "alt=" Wkiol1jajnxwxq3xaab5-lb24xq811.png "/>


From the above results, there is a-n option, indicating that all the displayed content of each line with line number, directly see the effect bar.

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/8E/71/wKiom1jAJ1yj84u5AAA6kvY7me0952.png "title=" 2017-03-08_23h46_09.png "alt=" Wkiom1jaj1yj84u5aaa6kvy7me0952.png "/>

As you can see, there is a line number in front of each line, and this is what we do with the-n effect. What if it's multiple files? Is it a uniform number or a separate number? Take a look at the effect.

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/8E/71/wKiom1jAKBmTwqOSAABA0QBfivw560.png "title=" 2017-03-08_23h49_19.png "alt=" Wkiom1jakbmtwqosaaba0qbfivw560.png "/>

From the above we can see that is the number of unified plus.


Another argument,-e: This option displays the line terminator for each line of content, and the line terminator on Windows and Linux is different. or directly look at the results.

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/8E/71/wKiom1jAKSri9AdOAAA6u89bBAA508.png "title=" 2017-03-08_23h53_51.png "alt=" Wkiom1jaksri9adoaaa6u89bbaa508.png "/>

As you can see, the line terminator on Linux is $


There is a similar command with the Cat command, called TAC, is it different from what it looks like? Two commands is not the letter reversed? The truth is that TAC, like Cat, is the command to display the text of a file, the only difference being the sort, the cat is the positive order, and the TAC is reversed, the others are exactly the same. or directly look at the effect:

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/8E/6F/wKioL1jAKqewYPy2AABpcSK4j4Y215.png "title=" 2017-03-08_23h59_35.png "alt=" Wkiol1jakqewypy2aabpcsk4j4y215.png "/>


Red Line area is gorgeous split line, is not the same as the content, sorting different? This command is also only the file content more, and also know what to find in the text of the last side of the time only need.


OK, I'll write it here today. Change the title later, call a Linux command every day.

This article is from the "bitter Siege Master's Notes" blog, please be sure to keep this source http://jiaszwx.blog.51cto.com/10565760/1904592

Linux Basic Command Introduction-3

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.