linux 将子文件夹的文件复制到 当前目录中
linux 将子文件夹的文件复制到 当前目录中,如
目录结构大概是
-sh
|__ db_backup
|___ test
|____ 2018_01_01_00_00_00
|_____ 2018_01_01_00_00_00.sql.gz
|___ backup
cp.sh
文件中的shell脚本大概是:
#!/bin/sh
cd /home/waka/sh/db_backup/test
cp $(find /home/waka/sh/db_backup/test/ -type f -name "*.sql.gz") /home/waka/sh/db_backup/test/backup