大概是这样的
find A -type f -maxdepth 1 -exec cp {} B/ \;
Run Code Online (Sandbox Code Playgroud)
和
find A -type d -maxdepth 1 -mindepth 1 -exec cp -r {} C/ \;
Run Code Online (Sandbox Code Playgroud)
-type标志在哪里,确定您要查找的类型(文件或目录)、- maxdepth目录的深度以及-exec对结果执行命令。
| 归档时间: |
|
| 查看次数: |
2726 次 |
| 最近记录: |