Linux exercises-Text processing tools sed (in construction)

Source: Internet
Author: User
1. Delete all whitespace characters in the CENTOS7 system/etc/grub2.cfg file that begin with whitespace at the beginning of the line

2. Delete all # and white space characters at the beginning of the line beginning with #, followed by at least one white-space character, in the/etc/fstab file

3. Add # At the beginning of each line of the CENTOS6 system/root/install.log

4. Add # to the beginning of the line in the/etc/fstab file that does not begin with #

5, processing/etc/fstab path, use sed command to take out its directory name and base name

6. Use SED to remove the IPv4 address of the ifconfig command

7. Statistics of all RPM files in the package directory on the CentOS installation CD. Number of repetitions of the second-to-last field

8. Count the number of occurrences of each word in the/etc/init.d/functions file and sort it (using grep and sed two methods respectively)

9. Merge N and n+1 lines of text file into one line, n is odd line


Linux exercises-Text processing tools sed (in construction)

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.