Fundamentals 6 min read

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.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Mastering ls -lrt: List Files by Modification Time in Linux

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.AppImage

Default 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.AppImage

Using 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.AppImage

Finally, 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.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Linuxfile-listingls command
Liangxu Linux
Written by

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.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.