Reputation: 4653
How do i copy files with with the certain prefixs e.g. LTE*.html
, Voicemail*.html
$ ls
2G_3G_cccccc.html other_dddd.html other3_dddd.html Voicemail_bbbbbb.html
LTE_aaaa.html other2_dddd.html subdir1
I have tried this but no joy
$ cp '(LTE*|Voice*).html' subdir1/
cp: cannot stat `(LTE*|Voice*).html': No such file or directory
So this would be the result I want
$ ls subdir1/
Voicemail_bbbbbb.html LTE_aaaa.html
Upvotes: 0
Views: 44
Reputation: 11593
Use brace expansion
cp {LTE,Voice}*.html subdir1/
Which expands to
cp LTE*.html Voice*.html subdir1/
Upvotes: 1