Linux grep exercises

Source: Internet
Author: User

1. Display the lines in the/proc/meminfo file that begin with a non-differentiated s;



2. Display the line ending with Nologin in/etc/passwd;



3, display/etc/inittab in the beginning of #, and followed by one or more white space characters, followed by any character line;




4, display/etc/inittab contains: A number: (that is, two colons in the middle of a number) line;



5. Display lines that start with one or more whitespace characters in the/boot/grub/grub.conf file;



6. Display a line in the /etc/inittab file that begins with a number and ends with a number that is the same as the beginning number;



7, ifconfig command can display the current host IP address related information, etc., if using grep and other text processing commands to remove the IP address of the machine, the requirements do not include 127.0.0.1;



8, display the/etc/sysconfig/network-scripts/ifcfg-eth0 file contains a similar IP address dotted decimal number format line;



Reprint please indicate Xiao Liu


Linux grep exercises

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.