I am trying to tar all the files in my downloads folder that was changed in the last 2 days. 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
这导致整个文件夹被存档,而不仅仅是更改的文件。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.