我正在运行以下命令:
mogrify -resize '400x400>' *.png
Run Code Online (Sandbox Code Playgroud)
注意“>”。据说它会忽略较小的文件,但虽然它不会调整它们的大小,但它会编辑它们(修改日期和文件大小已更改)。
有没有办法让它实际上只留下较小的文件?我想避免数千次不必要的写操作。
考虑这个例子:
touch test0
touch timestamp
touch test1
sudo find /var/www/import -iname 'test*' -newer timestamp -exec cp {} new \;
Run Code Online (Sandbox Code Playgroud)
它实际上复制文件 test1,但它返回消息:
touch test0
touch timestamp
touch test1
sudo find /var/www/import -iname 'test*' -newer timestamp -exec cp {} new \;
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
第二个问题,我可以在这个命令中使用“+”,以便将文件复制到一个“包”中吗?有成千上万的文件!