[Linux] CP bulk copy file

[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:

Share a picture

  b folder:

span>

share picture

[Use command]:

cp dir1/* dir2

cp example:

share picture

[Effect]:

  3 files in folder a have been copied to folder b

Share a picture

Reference documents:

linux——cp, Examples of wildcards and mv commands

cp dir1 /* dir2

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5137 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.