Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy a file with a name that follows a pattern

I need a linux command to copy a file which has a name that matches a certain pattern.

For example:

I have a file builds/myApp_v_4.1.apk and I want to copy it to artifacts/myApp_v_4.1.apk

However it can be myApp_v_4.2.apk or myApp_v_4.3.apk ...

So I'm looking for a way to copy the file that start with "myApp_v_" and ends with ".apk"

Is this dooable using the cp command?

thank you very much

like image 325
Y2theZ Avatar asked Oct 18 '25 11:10

Y2theZ


1 Answers

You can use:

cp builds/myApp_v_*.apk artifacts/
like image 130
anubhava Avatar answered Oct 21 '25 01:10

anubhava