Background
In Linux you can:
- List a group of files with
ls Filename*
- Remove a group of files with
rm Filename*
- Move a group of files with
mv Filename* /New/Directory
- But you cannot copy a group of files with:
cp Filename* *.bak
Change Linux cp
command to copy group of files
I have a group of files I'd like to copy without entering the names one by one and using the cp
command:
$ ls gmail-meta3*
gmail-meta3 gmail-meta3-REC-1558392194-26467821
gmail-meta3-LAB-1558392194-26467821 gmail-meta3-YAD-1558392194-26467821
How can I use something like the old DOS command copy gmail-meta3* *.bak
?
I don't want to type similar command four times:
cp gmail-meta3-LAB-1558392194-26467821 gmail-meta3-LAB-1558392194-26467821.bak
I'm looking for a script/function/app that accepts parameters for old and new filename group and not something with hard-coded filenames. For example, a user can type:
copy gmail-meta3* *.bak
or they might type:
copy gmail-meta3* save-*