find 后cp或拷贝目录结构
来源:互联网 发布:java网上订餐系统视频 编辑:程序博客网 时间:2024/06/03 18:05
find . -name '*.ctp' | xargs -i cp {} /home/www/web/
查找当前目录下所有ctp文件并复制到/home/www/web/目录下
【转】
[linux@/etc]# find `pwd`|grep 'conf$'|xargs -i cp {} /home/
这条命令会复制所有/etc及其子录下的最后的文件名为conf的文件到/home/目录下
注意:这个命令在Red Hat 9下通过 -i的意思用man xargs得如下内容:
--replace[=replace-str], -i[replace-str]
Replace occurences of replace-str in the initial arguments with
names read from standard input. Also, unquoted blanks do not
terminate arguments. If replace-str is omitted, it defaults to
"{}" (like for `find -exec'). Implies -x and -l 1.
Replace occurences of replace-str in the initial arguments with
names read from standard input. Also, unquoted blanks do not
terminate arguments. If replace-str is omitted, it defaults to
"{}" (like for `find -exec'). Implies -x and -l 1.
至于{}代表cp这个命令的第一个参数
[linux@/home]# pwd |xargs -i cp /etc/syslog.conf {}
上面这条命令会复制etc目录下的syslog.conf到当前目录下 {}这对括号表示的是cp的第二个参数,他的值由前面的pwd命令取得,并由xargs命令传给cp
find code-wmmp/* -type d | xargs -i install -d yy/{}
0 0
- find 后cp或拷贝目录结构
- linux cp 拷贝时 保留目录结构
- linux下使用cp拷贝指定文件或目录
- cp 拷贝时保留目录结构应用实例
- cp 拷贝,略过不想拷贝的目录
- shell脚本:cp某个目录下筛选(find)后的某些文件到另一个目录
- cp 复制文件或目录
- cp (复制档案或目录)
- cp 复制文件或目录
- cp 复制文件或目录
- find 查找本目录文件夹,并且带目录结构拷贝文件
- 困惑 紧跟指令mv或cp的cd指令无效--创建目录后自动进入相应目录
- 复制文件或目录命令:cp
- LINUX cp复制文件或目录
- cp(copy)复制文件或目录
- cp拷贝
- cp命令的简单实现(可拷贝目录)
- find:查找文件或目录
- MVCC浅析
- 使用共享内存的单机操作单位时间限制类
- 续行符的作用
- Cocos2d-x开发中遇到的问题汇总
- 关于python中的none
- find 后cp或拷贝目录结构
- uva11078
- CSDN版面出错了,你家里人知道吗?
- 常用的正则表达式,只用作例子分析
- 用常见的网盘搭建简单高效的SVN服务器
- 项目视频讲解_java邮件开发视频教程
- 题目1095:2的幂次方
- swing jTree 节点刷新,默认全部展开
- 黑马程序员-- 一、java基础