Bash Script to find the most recently modified file
Goes through some twists just to make sure to handle filenames with odd characters well, which mouviciel's doesn't:
NEWEST=$(find /Volumes/A /Volumes/B -name '*.bkf' -printf '%T@ %p\0' | \ sort -rnz | xargs -0n1 2>/dev/null | head -n1 | cut -d' ' -f2-)[[ -n "$NEWEST" ]] && cp -v "$NEWEST" /other-location
Actually, since these files are coming from Windows and are thus pretty much guaranteed not to have odd characters in their names (like embedded newlines),
NEWEST=$(find /Volumes/A /Volumes/B -name '*.bkf' -printf '%T@ %p\n' | \ sort -rn | head -n1 | cut -d' ' -f2-)[[ -n "$NEWEST" ]] && cp -v "$NEWEST" /other-location