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