My shell notes get a glimpse at the door-Linux general technology-Linux programming and kernel information. The following is a detailed description.
A glimpse of my shell notes
Today is the weekend. I feel good. continue with our study yesterday.
I have already shared the shell variables with you yesterday. today is the weekend, so it's easy to learn.
(1)
Shell wildcard
Wildcard characters are widely used for pattern matching, such as file name matching, path name search, and string search. The following are commonly used.
1. the "*" symbol is used to match strings that appear zero or multiple times. for example, l * can match like, li, and l. In other words, it is a string that matches all Strings prefixed with the "*" symbol.
2. "?" The symbol matches only one character at the corresponding position, for example, fil? File and filt can be matched, but filesystem cannot be matched, because? Only one character can be matched.
3. the [] symbol matches any character within the character group. The character groups in square brackets can be composed of directly given characters, or starting characters, ending characters, and a hyphen (-) that represents a limited range. For example, expression f [a-z] le can match related strings such as file, fale, and ftle.
When using square brackets, note that if the brackets contain the * and? Wildcard characters, which are considered to be common characters * and?
4. "!" The symbol is used with the [] symbol ,! Is used to match characters not listed in square brackets. For example, t [! A-z] st indicates that the matching character is not from a to z, so it can match tlst, t0st, and so on.
It's a weekend. have a good rest. Have a good weekend !!!
To be continued ······