2014-06-23 33 views
0

如何使用特定前缀复制文件LTE*.htmlVoicemail*.html复制具有特定前缀的多个文件

$ ls 
2G_3G_cccccc.html other_dddd.html other3_dddd.html Voicemail_bbbbbb.html 
LTE_aaaa.html  other2_dddd.html subdir1 

我已经试过,但没有喜悦

$ cp '(LTE*|Voice*).html' subdir1/ 
cp: cannot stat `(LTE*|Voice*).html': No such file or directory 

因此,这将是这个结果我想

$ ls subdir1/ 
Voicemail_bbbbbb.html LTE_aaaa.html 

回答

1

使用括号扩展

cp {LTE,Voice}*.html subdir1/ 

其扩展为

cp LTE*.html Voice*.html subdir1/ 
相关问题