The ls command is the most widely used command to display the contents in a directory on a Linux/Mac device terminal.
If you want to sort the output of the ls command by date and time you can make use of the -t option along with the ls -l command,
% ls -lt
total 60
drwx------ 1 root root 4096 Aug 7 17:28 root
drwxrwxrwt 1 root root 4096 Aug 7 17:20 tmp
drwxr-xr-x 5 root root 360 Aug 7 16:52 dev
dr-xr-xr-x 13 root root 0 Aug 7 16:52 sys
dr-xr-xr-x 180 root root 0 Aug 7 16:52 proc
drwxr-xr-x 1 root root 4096 Jul 31 17:20 etc
drwxr-xr-x 1 root root 4096 Jul 31 16:57 run
drwxr-xr-x 1 root root 4096 Jul 31 16:56 home
drwxr-xr-x 1 root root 4096 Apr 5 05:17 var
drwxr-xr-x 2 root root 4096 Apr 5 05:01 media
drwxr-xr-x 2 root root 4096 Apr 5 05:01 mnt
drwxr-xr-x 2 root root 4096 Apr 5 05:01 opt
drwxr-xr-x 2 root root 4096 Apr 5 05:01 srv
drwxr-xr-x 1 root root 4096 Apr 5 05:01 usr
lrwxrwxrwx 1 root root 7 Apr 5 05:01 bin -> usr/bin
lrwxrwxrwx 1 root root 7 Apr 5 05:01 lib -> usr/lib
lrwxrwxrwx 1 root root 8 Apr 5 05:01 sbin -> usr/sbin
drwxr-xr-x 2 root root 4096 Apr 15 2020 boot
In order to display the latest files and directories first as a list make use of -r option as well along with -lt
% ls -ltr
total 60
drwxr-xr-x 2 root root 4096 Apr 15 2020 boot
lrwxrwxrwx 1 root root 8 Apr 5 05:01 sbin -> usr/sbin
lrwxrwxrwx 1 root root 7 Apr 5 05:01 lib -> usr/lib
lrwxrwxrwx 1 root root 7 Apr 5 05:01 bin -> usr/bin
drwxr-xr-x 1 root root 4096 Apr 5 05:01 usr
drwxr-xr-x 2 root root 4096 Apr 5 05:01 srv
drwxr-xr-x 2 root root 4096 Apr 5 05:01 opt
drwxr-xr-x 2 root root 4096 Apr 5 05:01 mnt
drwxr-xr-x 2 root root 4096 Apr 5 05:01 media
drwxr-xr-x 1 root root 4096 Apr 5 05:17 var
drwxr-xr-x 1 root root 4096 Jul 31 16:56 home
drwxr-xr-x 1 root root 4096 Jul 31 16:57 run
drwxr-xr-x 1 root root 4096 Jul 31 17:20 etc
dr-xr-xr-x 181 root root 0 Aug 7 16:52 proc
dr-xr-xr-x 13 root root 0 Aug 7 16:52 sys
drwxr-xr-x 5 root root 360 Aug 7 16:52 dev
drwxrwxrwt 1 root root 4096 Aug 7 17:20 tmp
drwx------ 1 root root 4096 Aug 7 17:32 root
Conclusion:
- ls -l: l option to displays the output as a list
- ls -lt: t option to display list in order of oldest date to lastest date and time
- ls -ltr: tr option to display list in order of lastest date to oldest date and time

- How to Display content of a file in Terminal Screen?
- How to Install CVS Version Control on Linux/Ubuntu
- How to install and Configure sar sysstat tools in Ubuntu Linux
- ls command to list only directories
- [Ubuntu] Search a package and versions using apt command
- zsh hello world example
- Linux Remove or Delete Files and Directories using Terminal Commands
- How to tar.gz a directory or folder Command
- Calculate days between dates using dateutils ddiff command
- How to ls command to output one entry per line [macOS/Linux/Bash]
- 3 Commands to stop Nginx Server
- Create and write file in single Linux/macOS command
- SCP Copy all files from directory to Local Folder
- How to go to the End of File in Nano Editor
- How to remove/delete a directory in Linux/macOs
- How to Copy Entire Directory to another Directory in Linux
- Execute .bin and .run file Ubuntu Linux
- The Date Command and its usage [Linux - Unix - macOS]
- Fix - ssh-copy-id no identities found error
- How to check uptime of Linux/Unix/macOS system/server using console command?
- How to Select All text in vim/vi editor using Keyboard
- Linux: Create a New User and Password and Login Example
- Command to display epoch time Terminal
- How to install curl on Alpine Linux
- How to exit from nano command
- Fix Apache Tomca: java.lang.OutOfMemoryError: PermGen spaceError - Tomcat
- How to word wrap in HTML - Html
- Complete Reference of ArrayList Collection in Java with Examples - Java
- [Java] How to throws Exception using Functional Interface and Lambda code - Java
- [Solution] IDEA IntelliJ System.out.println function shortcut (sysout alternative for eclipse IDE) - HowTos
- Java JDBC Batch Update Example with PreparedStatement - Java
- How to kill tomcat server process using Mac Terminal Command - Tomcat
- How to create a New Project in Visual Studio Code (VS Code) - HowTos