Mastering ls -lrt: List Files by Modification Time in Linux
This guide explains the purpose of the ls -lrt command, breaks down its -l, -r, and -t options, shows how they combine to list directory contents sorted by time with the newest files at the bottom, and provides concrete command‑line examples for practical use.
The ls command lists directory contents; the -lrt combination is actually three separate options:
l : long format showing permissions, owner, size, timestamps, etc.
t : sort output by modification time.
r : reverse the sort order.
When combined as ls -lrt, the command displays files in long format, sorted by time in reverse order, so the oldest entries appear first and the newest files appear at the bottom of the list. The order of the options does not matter; ls -lrt and ls -ltr produce identical results.
Typical usage examples:
[email protected]:~/Apps$ ls</code>
<code>balenaEtcher-1.5.116-x64.AppImage pcloud cpufetch PenguinSubtitlePlayer-Linux Obsidian-0.13.19.AppImage ScreenCloud-v1.5.3-x86_64.AppImageDefault ls (no options) sorts alphabetically. Adding -l shows a detailed list while still sorting alphabetically:
[email protected]:~/Apps$ ls -l</code>
<code>total 304804</code>
<code>-rwxr-xr-x 1 abhishek abhishek 89697412 Feb 3 2021 balenaEtcher-1.5.116-x64.AppImage</code>
<code>drwxr-xr-x 6 abhishek abhishek 4096 Jul 23 2021 cpufetch</code>
<code>-rwxr-xr-x 1 abhishek abhishek 90800704 Jan 24 11:05 Obsidian-0.13.19.AppImage</code>
<code>-rwxr-xr-x 1 abhishek abhishek 57430439 Mar 17 07:52 pcloud</code>
<code>drwxr-xr-x 2 abhishek abhishek 4096 Mar 20 2021 PenguinSubtitlePlayer-Linux</code>
<code>-rwxr-xr-x 1 abhishek abhishek 74170408 Feb 13 20:26 ScreenCloud-v1.5.3-x86_64.AppImageUsing ls -lt sorts by time (newest first):
[email protected]:~/Apps$ ls -lt</code>
<code>total 304804</code>
<code>-rwxr-xr-x 1 abhishek abhishek 57430439 Mar 17 07:52 pcloud</code>
<code>-rwxr-xr-x 1 abhishek abhishek 74170408 Feb 13 20:26 ScreenCloud-v1.5.3-x86_64.AppImage</code>
<code>-rwxr-xr-x 1 abhishek abhishek 90800704 Jan 24 11:05 Obsidian-0.13.19.AppImage</code>
<code>drwxr-xr-x 6 abhishek abhishek 4096 Jul 23 2021 cpufetch</code>
<code>drwxr-xr-x 2 abhishek abhishek 4096 Mar 20 2021 PenguinSubtitlePlayer-Linux</code>
<code>-rwxr-xr-x 1 abhishek abhishek 89697412 Feb 3 2021 balenaEtcher-1.5.116-x64.AppImageFinally, adding the reverse flag -r to the -lt combination yields ls -lrt, which lists files from oldest to newest, making it easier to locate recently modified files when a directory contains many entries.
This command is especially useful when you need to inspect the most recent changes without scrolling through a long alphabetical list.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
