简体   繁体   English

使用相同的文件夹结构移动早于特定时间的文件和目录

[英]Move files and directories older than specific time with the same folder structure

I want to move all files and directories are located on /etc/ that are older than 90 days to /old-etc directory but with the same structure in the source directory. 我想将所有超过90天的文件和目录都位于/ etc /上,移至/ old-etc目录,但源目录中的结构相同。

Thanks 谢谢

尝试这样做:

find /etc -mtime +90 -type f -exec bash -c 'install -D "$1" "/old-etc/$1" && rm -f "$1"' -- {} \;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 搜索早于特定时间的文件并将其移至特定文件夹 - Searching files older than a specific time and move them into a specific folder 如何在cent OS中移动“ x”日之前的文件以及文件夹结构 - How to move files older than 'x' day along with folder structure in cent OS Linux 删除早于同一时间的文件 - Linux Delete Files Older Than and the Same Time Smaller Than linux中如何删除超过n天的文件和目录 - How to delete files and directories older than n days in linux 将多个文件从文件夹移动到目录列表(撤消移动命令) - Move multiple files from a folder to list of directories (Undo a move command) Shellscript - 检查文件夹并删除该文件夹中超过一小时的文件 - Shellscript - check a folder and delete files within that folder older than an hour unix:移动文件并保留文件夹结构 - unix: move files and keep folder structure 将创建时间或修改时间小于 25 分钟的文件移动到 ubuntu 中的不同文件夹 - move files whose creation time or modified time is less than 25 mins to a different folder in ubuntu 归档和删除超过 x 天的文件,维护目录结构 - Archive & delete files older than x days, maintaining the directory structure 将目录/文件输入文本文件,然后显示早于特定日期的文件 - Inputing directories/files into a text file and then showing files older than certain date
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM