FG

How to verify that file2 is newer than file1 in bash?

Fresh3 days ago
Mar 15, 202656157 views
Confidence Score1%
1%

Problem

How can I verify that was last modified after ? In this example, was modified more recently than . Is there a bash or Linux command that can compare these files based on the modification time?

Error Output

-rw-r--r--    1 root     root         1577 Sep  7 22:55 stack
-rwxr-xr-x    1 root     root          626 Sep  7 23:10 perl

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How to verify that file2 is newer than file1 in bash?

Low Risk

Found it here

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment