use of cp command with wild card

Kae Verens kae at verens.com
Thu Sep 18 11:55:07 UTC 2008


Roger Millington wrote:
> man find
> man cp
>   

or "rtfm" in otherwords - not nice, Roger...

> Gopal Ghosh wrote:
>   
>> dear all,
>> how to search for a group of files using wildcard and copy the result
>> content and redirecting it to a dir
>>     

you do not always need to use 'find'. You can use cp with globbing 
(search for "file globbing")

for instance:
"cp *test.txt ../test" will copy newtest.txt and oldtest.txt to ../test
"cp test[0-9].txt ../test" will copy test0.txt and test1.txt to ../test 
but will not copy testA.txt

kae




More information about the Fedora-laptop-list mailing list