简体   繁体   English

最近 2 天内修改过的 tar 文件

[英]Tar files that were modified in the last 2 days

I am trying to tar all the files in my downloads folder that was changed in the last 2 days.我正在尝试对过去 2 天内更改的下载文件夹中的所有文件进行 tar。 When I execute the below, it instead tar's all the files inside my Downloads folder当我执行下面的命令时,它代替了我的下载文件夹中的所有文件

find ~/Downloads -mtime 2 -print0 | xargs -0 tar -cvfz test.tar.gz 

尝试使用 -mtime -2,在两天内压缩所有文件。

确保使用find ~/Downloads/*而不是find ~/Downloads因为find ~/Downloads还将返回父文件夹~/Downloads这导致整个文件夹被存档,而不仅仅是更改的文件。

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

相关问题 查找过去 x 天内未访问的文件 - Find files that were not accessed in the last x days 如何找到最近10天内被修改但不在bash终端上的“ CVS”,“ build”或“ classes”文件夹中的文件? - How do I locate files which were modified within the last 10 days but and NOT in a “CVS”, “build” or “classes” folder on a bash terminal? Bash ,查找最近 x 天的修改过的文件 - Bash , Find modified files for the last x days 复制/停止过去14天内修改过的文件 - Copying / Tarring Files that have been modified in the last 14 days 如何创建 tar 文件以保持目录结构完整并根据上次修改日期排除某些文件 - how do I create tar file keeping directory structure intact and excluding some files based on the last modified date 我试图在 Linux 中查找过去 10 天内创建或修改的最大文件 - im trying to find the largest files created or modified within the last 10 days within Linux 如何删除具有X天有效期(而不是最后修改)的文件。 可能吗 的Linux - How to delete files which have X days lifetime, not last modified. Is it even possible. Linux 获取自上次修改文件以来的天数 - Get the number of days since file is last modified 查找在某个文件之前被修改的文件 - finding files that were modified before a certain file 仅在路径中列出的最后一个目录中的 Tar 文件 - Tar files only in last directory listed in a path
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM