【发布时间】:2013-12-04 00:48:45
【问题描述】:
您好,我有两个目录
目录 1:
song.mp3
work.txt
目录 2:
song.mp3
work.txt
这些文件是一样的,但是 directory1 中的 song.mp3 比 directory2 中的 song.mp3 新,并且目录 2 中的 work.txt 比目录 1 中的 work.txt 最新。
现在我如何打印两个文件,例如 在 file1 中的文件比目录 2 中的文件更新,所以它必须是 song.mp3 并且在 file2 文件中比目录 1 中的文件更新,所以它必须是 work.txt
我试过了
find $directory1 -type f -newer $directory2
但它总是向我打印两个目录中的最新文件。有人可以帮我吗?
【问题讨论】: