linux使用cp复制文件到多个目录
工具cpawkfind实例$ pwd/home/dev/tmp/d$ ls -R.:bp-ft-f./p-f:hooks./p-f/hooks:./t-f:hooks./t-f/hooks:复制/home/dev/tmp/d/b到hooks目录下$ find `pwd` -name "*-f" | awk "{print \$1\"/hooks\"}" | xargs -n
·
工具
- cp
- awk
- find
实例
$ pwd
/home/dev/tmp/d
$ ls -R
.:
b p-f t-f
./p-f:
hooks
./p-f/hooks:
./t-f:
hooks
./t-f/hooks:
复制/home/dev/tmp/d/b
到hooks目录下
$ find `pwd` -name "*-f" | awk "{print \$1\"/hooks\"}" | xargs -n 1 cp b
$ ls -R
.:
b p-f t-f
./p-f:
hooks
./p-f/hooks:
b
./t-f:
hooks
./t-f/hooks:
b
更多推荐
已为社区贡献2条内容
所有评论(0)