Suppose we have two directories, dirA, dirB, which the exact same PDF files, just different last modified.
What is a bash script (no awk) that can search through each file name (assume always in both dirA, dirB) and for each filename, outputs which of the files (dirA/file or dirB/file) has the greater last-modified; file-modified-last?
e.g.
if dirA/file.lastmodified > dirB/file.lastmodified
##take action
Best Answer
With GNU stat: