cp dir recursivly不包括2个子目录
16lz
2021-01-22
I have 1 directory with 9 subdirectories and 10 files. Subdirectory have next level subdirectories and files.
我有1个目录,包含9个子目录和10个文件。子目录具有下一级子目录和文件。
/home/directory/
/home/directory/subdirectory1
/home/directory/subdirectory2
...
/home/directory/subdirectory9
/home/directory/file1
...
/home/directory/file10
I want to copy all subdirectories and files recursivly excluding:
我想复制所有子目录和文件,但不包括:
/home/directory/subdirectory5
/home/directory/subdirectory7
What is the best way for it?
最好的方法是什么?
7 个解决方案
#1
8
Maybe the find
command will help you:
也许find命令可以帮助你:
$ find /home/directory -mindepth 1 -maxdepth 1 -name 'subdirectory[57]' -or -exec cp -r {} /path/to/dir \;
更多相关文章
- Linux locate(文件搜索) 命令
- 开发板挂载vmware虚拟机linux下nfs服务器共享文件
- Linux 删除除了某个文件之外的所有文件
- linux设置了 /etc/profile ~/.bashrc等配置文件不重启生效方法【
- Inotify: 高效、实时的Linux文件系统事件监控框架
- Linux中/proc目录下文件详解之(二)
- Linux如何查找大文件
- Linux第三章 命令基本格式及文件处理命令
- NFS实现开发板和虚拟机之间的文件共享