Use the sed command to view logs

Source: Internet
Author: User
Use the sed command to view the log # display part of the text & mdash; specify the row number range (from 8th to 12th rows, including 8 and 12 rows) sed-n & amp; rsquo; 8, 12 p & amp; rsquo; # method 1sed & amp; rsquo; 8, 12! D & amp; rsquo; # method 2www. 2CT...
Use the sed command to view the log # display part of the text-specify the row number range (from 8th to 12th lines, including 8 and 12 lines) sed-n'8, 12p' # Method 1 sed '8, 12! D' # Method 2 www.2cto.com # display 52nd rows of sed-n '52p' # Method 1 sed '52! D' # Method 2 sed '52q; d' # method 3, which is more efficient when processing large files # Only display rows matching regular expressions (simulate "grep ") sed-n'/regexp/p' # Method 1 sed '/regexp /! D' # Method 2
 

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.