[Requirements]:
There are 2 folders a, b, now you need to copy all the files (aa.py, a2.py, a3.py) in folder a to folder b (empty folder)
[Solution Method]:
The first thing that comes to mind is to use regular expressions, but I found that In linux, only grep, awk, sed and other commands can support regular expressions.
And commands like ls, find, cp are not supported Regular expressions, but you can use the shell’s own wildcards to match
[Example]:
a folder:
b folder:
span>
[Use command]:
cp dir1/* dir2
cp example:
[Effect]:
3 files in folder a have been copied to folder b
Reference documents:
linux——cp, Examples of wildcards and mv commands
cp dir1 /* dir2