Linux查找并复制用户文件: 如何将student用户的文件拷贝到/root/findfiles目录
- 打开终端
- 输入以下命令以查找拥有者为student的普通文件,并将其复制到/root/findfiles目录:
find / -type f -user student -exec cp {} /root/findfiles ;
解释:
find /: 在根目录下查找文件-type f: 查找普通文件-user student: 查找拥有者为student的文件-exec cp {} /root/findfiles ;: 将找到的文件复制到/root/findfiles目录中,'{}'表示找到的文件,';'表示命令结束
- 等待命令执行完成,复制的文件会出现在/root/findfiles目录中。
原文地址: https://www.cveoy.top/t/topic/nUvy 著作权归作者所有。请勿转载和采集!