15-Ubuntu- file and directory commands - (2) -ls-2

4. ls and using wildcards

Wildcard where applicable: shell command line or shell script.

Regular expressions where applicable: when a string handling, regular and generally have general Perl regular.

Regular expressions and wildcards have the same sign but different meanings !!

 

Regular Expressions meaning Tsuhaifu meaning
* For a character zero or infinite extension * 0 to match any number of characters
? For the previous character 0 or 1 extension ? Matches any single character
[] Characters, a single character is given in the range of [] Any character set of a match
[abc] Represents a or b or c [abc] Matching a, b, c of any one of
[a-f] A represents any of a to f [a-f] F a match to an arbitrary range within a

Example:

View desktops that meet the [123] file [1234] 3.txt of

1 ls [123][1234]3.txt

Guess you like

Origin www.cnblogs.com/summer1019/p/11059348.html