Linux Tip: ls-l-View file information, sorted by time and size
First, sort by time:
Ascending order is the arrangement of data from low to high, and descending order is the arrangement of data from high to low
Ls in descending chronological order: ls-lt (most commonly used)
Ls in ascending chronological order: ls-lrt
View files by file modification time:
Plus-r is the reverse sort:
The command explains:
-t: sort by modification time. In fact, we can use the man ls command to see the use of the parameters with the ls command.-t sort by modification time,newest first sorts files by modification time. The default is the most recently modified first.
-r: reverse sort, reverse order
Example: ls-ltr: sort in reverse by modification time [that is, the latest modification time comes last]
Sort by file size:
Plus-h displays the file size with units:
The command explains:
Ls-lS is sorted from largest to smallest
Ls-Slr is sorted from small to large
Ls lSh | ls-lShr if you want to type in a "human-readable way", add a-h to indicate "--human-readable"
In this way, the unit is k or M, and it is easier to see the results clearly.