You run ls, scan a crowded directory, and still cannot tell which file changed most recently. The ls -ltr command solves that in four characters of flags: it prints full details for every entry and sorts them so the oldest file sits at the top and the newest sits at the bottom, right above your next command.
The sections below cover what each flag contributes, how to read every column of the output, and the combinations that answer the questions you actually have: which file moved last, which entries are directories, and which file grew large. Every command shown here was executed on a current Linux system, and the screenshots come from those exact runs. If you need the broader option set first, start with how to use the ls command in Linux.
What Each Flag Does
The command stacks three independent options, and ls applies all of them in one pass.
| Flag | Long form | Job |
|---|---|---|
| -l | –format=long | Prints one entry per line with permissions, owner, size, and timestamps |
| -t | –time | Sorts entries by modification time, newest first |
| -r | –reverse | Reverses whatever sort is active |
Order inside the flag cluster makes no difference, so ls -ltr and ls -lrt produce identical output. The default ls sort is alphabetical, and the manual states that any time-based or size-based sort replaces it only when you pass a flag like t, S, or u. That is why -t matters here: without it, -r would simply reverse alphabetical order.
Reading One Line of Output
Each row packs eight fields into a fixed layout. Here is one line from the test directory after running ls -ltr.
drwxrwxr-x 2 ubuntu ubuntu 4096 Aug 26 03:42 src
| Field | Value | Meaning |
|---|---|---|
| Type and permissions | drwxrwxr-x | d marks a directory, then owner, group, and other permissions |
| Hard links | 2 | Count of names pointing at this inode |
| Owner | ubuntu | User who owns the entry |
| Group | ubuntu | Group owner |
| Size | 4096 | Bytes on disk, 4 KB for a directory entry |
| Modification date | Aug 26 | Month and day, or a year for older files |
| Time | 03:42 | Hour and minute for recent files |
| Name | src | File or directory name |
One detail trips people who read listings months later: ls switches from showing the time to showing the year once a file has not been touched for over half a year. If a listing shows Aug 25 instead of Aug 25 03:42, the file is old, not broken. The chmod and chown guide explains how to change the permission bits in the first field when you need to.
Running It on a Test Directory
Create a few files a minute apart, then list them.
echo "log line A" > app.log
echo "config v2" > app.conf
touch data.csv archive.tar.gz
mkdir src
sleep 61
echo "recent fix" > patch.log
ls -ltr

patch.log lands last even though it was created last in the sequence, because the sleep pushed its modification time one minute past everything else. That bottom position is the whole point of the r flag: the file you most likely care about never requires scrolling.
See only the newest entries
Pipe the listing into tail when a directory holds hundreds of files and you only want the recent end.
ls -ltr | tail -5
tail -1 gives you exactly the single most recently modified entry. This pairing works well right after a build or deploy, when you want to confirm which artifacts actually changed.
Make sizes readable
Raw byte counts are precise but slow to compare. Adding h, for human-readable, scales them into K, M, and G units.
ls -ltrh

The 4096-byte directory entry becomes 4.0K. Nothing about the ordering changes, since h affects display only. When you need to trace where disk space actually goes rather than reading one directory, follow up with the tools in the CPU, disk, and memory usage guide.
List regular files only
Directories share the same listing as files, which clutters the view when you are hunting documents. The first character of every line encodes the type: a dash means a regular file and d means a directory. Filtering on that character removes the noise.
ls -ltr | grep ^-

The src directory disappears from the output while every file keeps its time order. The anchor ^ pins the match to the start of the line so filenames containing dashes cannot fool it. More filters like this live in the grep command tutorial.
Variations Worth Knowing
The same three flags combine with a few others to answer related questions.
| Command | What changes |
|---|---|
| ls -lt | Newest first instead of oldest first |
| ls -lrta | Includes hidden dotfiles such as .bashrc |
| ls -ltrS | Sorts by size, largest last, ignoring time |
| ls -ltru | Sorts by access time instead of modification time |
| ls -ltr –full-time | Shows seconds and the timezone for each timestamp |
The u flag matters when a process reads many logs and you want evidence of activity rather than edits. Modification time changes only when file contents change, which is why it is the default choice for this sort.
Find Files Modified Today Without Parsing ls
Scripts that consume ls output break on spaces in filenames, because the listing was designed for people, not programs. When the goal is to act on recent files, use find, which emits raw paths one per line.
find . -maxdepth 1 -type f -mmin -60 -printf '%T@ %p\n' | sort -n
This lists regular files modified in the last hour, sorted oldest to newest by numeric epoch time. Keep ls -ltr for interactive work and reach for find the moment a script needs the same information. To count or batch-process matches, the guide on counting files in a directory covers those workflows.
What does ls -ltr stand for?
It combines three flags: l for the long listing format, t for sorting by modification time, and r for reversing the sort so the oldest entry appears first and the newest appears last.
When should I use ls -ltr instead of ls -l?
Use ls -l when alphabetical order helps you find a known filename. Use ls -ltr when you want to see which files changed most recently, because the newest entries land at the bottom near your prompt.
How do I show only the most recently modified file?
Run ls -ltr | tail -1. The tail command prints the last line, which is always the newest entry under this sort order.
What is the difference between ls -ltr and ls -lrt?
Nothing. Flag order does not matter to ls, so both commands produce identical output.
Run ls -ltrh in the directory you were just working in. The newest line tells you whether the command you ran a minute ago did what you expected, and from there the rest of the listing answers itself.
