Linux using notes 6

Source: Internet
Author: User

---restore content starts---

1. Append content

Append the contents of one file to another file:

Cat First.txt >> second.txt//append to the end of the Second.txt file

Cat first.txt > second.txt//overwrite content in Second.txt file

2. View head, tail, etc.

View Header:

Head-n the number of rows to display after My.txt//-n

View Tail:

Tail-n the number of rows to display after My.txt//-n

To view a specific number of lines:

Starting at line No. 3000, displays 1000 rows. The 3000~3999 line is displayed

Cat FileName | Tail-n +3000 | Head-n 1000

Display 1000 rows to 3000 rows

Cat filename| Head-n 3000 | Tail-n +1000

Command with SED

Sed-n ' 5,10p ' filename so you can only view lines 5th through 10th of the file.

---restore content ends---

Linux using notes 6

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.