December 1999
Beginner
528 pages
11h 10m
English
Use the ? to match any single character. Here we list filenames where the first two characters can be any character, followed by an ‘R’, followed by any string:
$ ls ??R*
BAREAD
In the following example, we list files that start with ‘conf’, followed by any two characters, followed by ‘.log’:
$ ls conf.??.log
conf12.log conf.23.log
conf25.log
To match all filenames that start with ‘f’, followed by any two characters, followed by any string; the end character must be an ‘s’:
$ ls f??*s
ftpaccess ftpconversions
ftpgroups ftphosts
ftpusers
Read now
Unlock full access