工具
- 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