To view files in Linux, sometimes you need to sort the files.
For example, the WebLogic, Oracle directory, is not sorted by creation time or file size by default.
[Email protected] oracle]$ ls-l
Total 184
Drwxr-xr-x 6 web WebLogic 4096 07-02 09:19 coherence_3.7
-RW-RW----1 Web weblogic 426 07-02 09:29 domain-registry.xml
Drwxr-xr-x 2 web weblogic 4096 07-11 11:12 logs
Drwxr-xr-x 7 web WebLogic 36864 07-02 09:16 Modules
-rw-r--r--1 Web weblogic 849 07-02 09:19 OCM.RSP
-rw-r--r--1 Web weblogic 108849 07-02 09:19 registry.dat
-rw-r--r--2 Web weblogic 1908 07-02 09:19 registry.xml
-rw-r--r--1 Web weblogic 1908 07-11 11:10 registry.xml--
Drwxr-x---3 web weblogic 4096 07-02 09:24 user_projects
Drwxr-xr-x 8 web WebLogic 4096 07-02 09:18 utils
Drwxr-xr-x 8 web WebLogic 4096 07-02 09:19 wlserver_10.3
1, by the creation time to sort, defaults to the time most recent pre-row
[Email protected] oracle]$ LS-LT
Total 184
Drwxr-xr-x 2 web weblogic 4096 07-11 11:12 logs
-rw-r--r--1 Web weblogic 1908 07-11 11:10 registry.xml--
-RW-RW----1 Web weblogic 426 07-02 09:29 domain-registry.xml
Drwxr-x---3 web weblogic 4096 07-02 09:24 user_projects
Drwxr-xr-x 6 web WebLogic 4096 07-02 09:19 coherence_3.7
Drwxr-xr-x 8 web WebLogic 4096 07-02 09:19 wlserver_10.3
-rw-r--r--2 Web weblogic 1908 07-02 09:19 registry.xml
-rw-r--r--1 Web weblogic 108849 07-02 09:19 registry.dat
-rw-r--r--1 Web weblogic 849 07-02 09:19 OCM.RSP
Drwxr-xr-x 8 web WebLogic 4096 07-02 09:18 utils
Drwxr-xr-x 7 web WebLogic 36864 07-02 09:16 Modules
2, sorted by file size, note that the parameter is uppercase S, the default is the largest file row before
[Email protected] oracle]$ Ls-ls
Total 184
-rw-r--r--1 Web weblogic 108849 07-02 09:19 registry.dat
Drwxr-xr-x 7 web WebLogic 36864 07-02 09:16 Modules
Drwxr-xr-x 6 web WebLogic 4096 07-02 09:19 coherence_3.7
Drwxr-xr-x 2 web weblogic 4096 07-11 11:12 logs
Drwxr-x---3 web weblogic 4096 07-02 09:24 user_projects
Drwxr-xr-x 8 web WebLogic 4096 07-02 09:18 utils
Drwxr-xr-x 8 web WebLogic 4096 07-02 09:19 wlserver_10.3
-rw-r--r--2 Web weblogic 1908 07-02 09:19 registry.xml
-rw-r--r--1 Web weblogic 1908 07-11 11:10 registry.xml--
-rw-r--r--1 Web weblogic 849 07-02 09:19 OCM.RSP
-RW-RW----1 Web weblogic 426 07-02 09:29 domain-registry.xml
The 5th column is the file size and the largest file is Registry.dat.
3, reverse order (inverted row), using the-R parameter
[Email protected] oracle]$ LS-LSR
Total 184
-RW-RW----1 Web weblogic 426 07-02 09:29 domain-registry.xml
-rw-r--r--1 Web weblogic 849 07-02 09:19 OCM.RSP
-rw-r--r--1 Web weblogic 1908 07-11 11:10 registry.xml--
-rw-r--r--2 Web weblogic 1908 07-02 09:19 registry.xml
Drwxr-xr-x 8 web WebLogic 4096 07-02 09:19 wlserver_10.3
Drwxr-xr-x 8 web WebLogic 4096 07-02 09:18 utils
Drwxr-x---3 web weblogic 4096 07-02 09:24 user_projects
Drwxr-xr-x 2 web weblogic 4096 07-11 11:12 logs
Drwxr-xr-x 6 web WebLogic 4096 07-02 09:19 coherence_3.7
Drwxr-xr-x 7 web WebLogic 36864 07-02 09:16 Modules
-rw-r--r--1 Web weblogic 108849 07-02 09:19 registry.dat
Note: The 2nd column means the number of hard links or directories , the number of hard links to the file, and the number of subdirectories for the folder.