linux【备份】

  1. 备份特定文件,带目录结构
1.打包
find . -type f -regex ".*config.xml" | xargs tar czvf config_bak.tar.gz   
2.复制【带目录】
find . -type f -regex ".*config.xml" | xargs -i cp --parents {}  bak    # -i 表示 find 传递给xargs的结果 由{}来代替
原文地址:https://www.cnblogs.com/amize/p/15322799.html