Linux Shell Basics

Source: Internet
Author: User

  The bash shell itself does not support regular expressions, and the use of regular expressions is shell commands and tools such as grep, SED, awk, and so on;

However, thebash shell can use some metacharacters in the regular expression to implement the wildcard (Globbing) function, which is to store a non-specific file name extension that contains a wildcard character in the computer

A batch of files with filenames on a server or network.

The most common wildcard characters include regular expression metacharacters:? * [] {} ^ and so on. The meanings of these meta-characters in the wildcard are not exactly the same as those in regular expressions;

"*": does not represent the repetition of its preceding character, but represents any character of any bit;

"?": denotes an arbitrary character

"^": does not represent the beginning of the line, but represents the reverse;

"[]": Special case, the character is the same as in regular expressions;

' {} ': Represents a set of expressions;

Example:

[A-h]*.awk: A file that starts with a letter in the A~h range and ends with an. awk;

[A-h]*. [^awk]*: Represents a file in the A~h range that begins with a letter that does not end with awk; NOTE: "*" is necessary, otherwise the period matches only one character;

{[a-h]*. [^awk]*, O?. PEM}: Indicates satisfying [a-h]*. [^awk]* or O?. All files of PEM;

Description: The results of the matching of the computer search a large number of files or directories to match and output, the ability to pair processing and memory resources have high requirements.

The hacker enters a file name that contains wildcards and intentionally causes the server to repeatedly and continuously pass a denial-of-service attack that may be caused by a wildcard, so large servers often

By restricting the number of times the server performs the wildcard function, restricting the wildcard characters entered by a specific user each time, or if the wildcard is too common, it refuses to perform a wildcard to improve the security of the server;

grep usage:

  

  

Linux Shell Basics

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.