Shell Pattern Matching

Source: Internet
Author: User

Special characters in shell pattern matching
* Matches any string (including an empty string).
? matches any single character .
[...] Matches any character that is contained.

Precautions:

' * ' uses ' * * ' in the file name extension to match all files and 0 or more subdirectories. If you add '/' to the end of the pattern, only the matching directory and subdirectories do not match the file.

[...] If a pair of characters is separated by a hyphen (-) then a range is represented. If the first character in [] is '! ' or ' ^ ' then the [] pattern will become mismatched any characters contained.

For example: [A-dx-z] is equivalent to [ABCDXYZ]

Extglob Options Open

The following pattern matching is supported if the EXTGLOB option ( Shell built-in command shopt extglob option ) is turned on in the shell.

Multiple parameters can use the ' | ' To split.

Shell Pattern Matching

Related Article

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.