POSIXLY:
f1=/path/to/file_1 f2=/path/to/file_2 if [ -n "$(find -L "$f1" -prune -newer "$f2" -exec echo . \;)" ]; then printf '%s is newer than %s\n' "$f1" "$f2" fi Using absolute path to files prevent a false positive with filename contains newlines only.
In case of using relative path, then change find command to:
find -L "$f1" -prune -newer "$f2" -exec echo . \;