Usually the Linux "ls -l" command only shows the date, which is often just fine but when running through large lists where the timestamp matters, its rather useless.
Eg:
$ ls -l
drwxr-xr-x 2 root root 16384 Aug 4 09:00 0
drwxr-xr-x 2 root root 20480 Aug 5 09:00 1
drwxr-xr-x 2 root root 20480 Aug 8 09:00 2
drwxr-xr-x 2 root root 16384 Aug 10 05:08 3
drwxr-xr-x 2 root root 12288 Aug 10 10:03 4
drwxr-xr-x 2 root root 16384 Aug 1 09:00 5
Timestamp with seconds: YYYY-MM-DD HH:MM:SS
To see the timestamp including seconds one needs to enter this command:
ls -l --time-style=+'%Y-%m-%d %H:%M:%S'
Not something I'd care for typing, but good if you need it only once in a blue moon, but results in just what we want:
$ ls -l --time-style=+'%Y-%m-%d %H:%M:%S'
total 332
drwxr-xr-x 2 root root 16384 2026-08-04 09:00:00 0
drwxr-xr-x 2 root root 20480 2026-08-05 09:00:17 1
drwxr-xr-x 2 root root 20480 2026-08-08 09:00:34 2
drwxr-xr-x 2 root root 16384 2026-08-10 05:08:03 3
drwxr-xr-x 2 root root 12288 2026-08-10 10:03:32 4
drwxr-xr-x 2 root root 16384 2026-08-01 09:00:05 5
To make this permanent, one can set the TIME_STYLE environment variable like so:
export TIME_STYLE=+'%Y-%m-%d %H:%M:%S'
From now on, "ls -l" will result in the full timestamp even with seconds (HH:MM:SS).
Timestamp without seconds: YYYY-MM-DD HH:MM
To see the timestamp including seconds one needs to enter this command:
ls -l --time-style=+'%Y-%m-%d %H:%M'
or:
ls -l --time-style=long-iso
If you do not care for the seconds, then you can try this, which results YYYY-MM-DD HH:MM (without the seconds):
export TIME_STYLE=long-iso
Which would result into something like this:
# ls -l
total 332
drwxr-xr-x 2 root root 16384 2026-08-04 09:00 0
drwxr-xr-x 2 root root 20480 2026-08-05 09:00 1
drwxr-xr-x 2 root root 20480 2026-08-08 09:00 2
drwxr-xr-x 2 root root 16384 2026-08-10 05:08 3
drwxr-xr-x 2 root root 12288 2026-08-10 10:03 4
drwxr-xr-x 2 root root 16384 2026-08-01 09:00 5
Note this is not so very relevant for macOS users, as Terminal/ls already shows the timestamp.
Hope this is useful to someone 😊