Wildcards are relatively simple. We already know that wildcards are often used to match filenames in the shell terminal, so take a look at the example of using wildcards in the LS command today.
Usage: LS [option] ... [File] ...
LS itself has a lot of options, we do not look at the option today, but instead look at its parameters section.
Now we have a total of 8 files in the current directory $ls1. C1.CPP 1. h3. C3.CPP 3. h a.out Readme list all files $ls*1. C1.CPP 1. h3. C3.CPP 3The . h a.out Readme lists 1 files that begin with a 1-character extension (this is considered to have a full name in the filename. That is, there is an extension) $ls 1.?1. C1. h lists files beginning with 1 and the extension is at least 1 characters in $ls 1.? *1. C1.CPP 1. h list all files with an H extensionls*. h1. h3. h list all files with extension $ls*.*1. C1.CPP 1. h3. C3.CPP 3. h a.out Lists the file name is 1-3 of 1 characters, and the file name extension is H $ls[1-3].h1. h3. h lists all files that have an extension, and the first letter of the extension is not C $ls*. [^c]*1. h3. h a.out Lists the file name is 1-3 of 1 characters, and the file name extension is C or H $ls[1-3]. [CH]1. C1. h3. C3. h lists the extension before it is a single character, and the first character of the extension part is the C file $ls?. c*1. C1.CPP 3. C3.CPPHow do I list a file without an extension? I need to use grep (if you have another way, welcome to reply) $ls|grep-V"\."Readme
Original articles, copyright, reproduced please indicate the source.
Using wildcard characters in the LS command