copy files with double quotes and matching pattern

Viewed 1116

I have files which need to be copied to the folder. There would be matching pattern. For example: If test.cls is there. Along with that file, test.cls-meta.xml also needs to be copied. I would use test.cls* to copy both the files Usually i use the following command

cp test.cls* directory/

some file names have spaces in between. So I had to put files in double quotes to handle the spaces. But it is failing as it is assuming * as part of name. How to resolve this problem?

cp "test.cls*" directory/
cp: cannot stat ‘test.cls*’: No such file or directory
1 Answers
Related