A summary of the use of Linux wildcard characters

Source: Internet
Author: User

Tagged with: Linux wildcard character globbing

First, wildcards are a way for the shell to extend functionality. In the shell of Linux, the difference between the expressions of the wildcard wildcards regular is to be distinguished.

Simply understood, wildcard characters are used to match filenames. The regular expression is used to match the contents of the file.

To understand wildcard characters, first, you need to memorize the metacharacters in the wildcard:

*: Indicates any character that matches any length. Need to be aware of any length, including 0 length, i.e. no characters

? : Matches an arbitrary character that matches only one character

Range Matching:

[0-9]: Indicates a matching number

[A-Z]: Indicates a matching lowercase letter

[A-Z]: indicates matching uppercase letters

Range matching Inverse:

[^0-9]: Indicates a match to a non-numeric

[^a-z]: Indicates matching non-lowercase letters

[^a-z]: Indicates a match to a non-uppercase letter

Special Matching method:

[[: Space:]]: Indicates matching whitespace characters

[[:p UNCT:]]: Indicates matching punctuation

[[:d Igit:]]: Indicates a matching number

[[: Lower:]]: Indicates a matching lowercase letter

[[: Upper:]]: Indicates matching uppercase letters

[[: Alpha:]]: Indicates matching letters, not case sensitive

[[: Alnum:]]: Indicates a matching alphanumeric number.

The special matching method also supports inversion, which is reversed as follows:

[^[::]]


A summary of the use of Linux wildcard characters

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.