CS155 Wildcards
Vocabulary | |
---|---|
Punctuation | * , ? , [] , {} |
Grammar |
*
, ?
, []
, {}
*
– match zero or more characters
?
– match any one character
[]
– match any characters in the brackets
{}
– match any word in the brackets
Select all files ending in .txt
*.txt
Select all files beginning with assignment
assignment*
Select any file beginning with Homework_
,
Homework_*
Select any file beginning with Homework_
,
followed by 1
, 2
, 3
, or 4
, and ending with .file
Homework_[1-4].file
Select rod.flanders.file
and tod.flanders.file
[rt]od.flanders.file
Select any file ending with .txt
or .jpg
. Note the comma!
*.{txt,jpg}
Move all .txt
files into the directory files
% mv *.txt files
Remove all files beginning with HW
, followed by a digit,
and ending with .file
% rm HW[0-9].file
List all files ending with .txt
or .jpg
% ls -l *.{txt,jpg} | more
Modified: 2017-01-22T22:49 User: Guest Check: HTML CSSEdit History Source |
Apply to CSU |
Contact CSU |
Disclaimer |
Equal Opportunity Colorado State University, Fort Collins, CO 80523 USA © 2015 Colorado State University |