Marco -51cto-linux Training-5-Regular expressions

Source: Internet
Author: User

Exercise: 1 . Displays the line in the/etc/passwd file that ends with bash.

cat/etc/passwd |grep ' bash$ '

2 . Displays the two-digit or three-digit number in the/etc/passwd file.

cat/etc/passwd |grep ' [[:d igit:]]\{2,3}\ '

3 . Displays the line with ' LISTEN ' followed by 0, one or more whitespace characters in the ' netstat-tan ' command result.

       cat/etc/passwd |grep ' listen[[:space:]]\{0,\}$ '

      4,

       useradd bash

       useradd testbash

       useradd basher

       useradd nologin-s/bin/nologin


650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>


Marco -51cto-linux Training-5-Regular expressions

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.