LS Sort output file list by time
First, LS--help looks at LS-related parameters related to time sequencing:
> ls--help|grep-e "Time|sort"
If you do not specify any of the options for-cftusux or--sort, sort by letter size.
-C mate-lt: Sorts and displays CTime according to CTime (file
Mate-L: Show CTime but sort by name
Otherwise: Sort by ctime
-F do not sort, enable-au, disable-lst
--full-time like-l--time-style=full-iso
-R,--reverse reverse order while sorting
-s sort by file size
--sort=word extension-x, None-u, Size-s, Time-t,
Version-v, Status-c, Time-t, Atime-u,
--time=word with-l, Show time as WORD instead of modification
Time:atime, access, use, ctime or status; Use
Specified time as sort key if--sort=time
--time-style=style with-l, show times using style style:
-t Sort by modification time
You can see the-C by creation time CTime sort,-t by the modified time Mtime sort, by default is the most recent file in front,-R can be sorted in reverse order, near the nearest file,--sort=word can be ordered ordering key values.
Common combinations are as follows:
> Ls-alt # Sort by modified time
> LS--sort=time-la # equivalent to > Ls-alt
> Ls-alc # Sort by creation time
> Ls-alu # Sort by access time
# All above can be sorted in reverse order using-R
> LS-ALRT # Sort by modified time
> LS--SORT=TIME-LRA # equivalent to > LS-ALRT
> LS-ALRC # Sort by creation time
> Ls-alru # Sort by access time
# You can also find files of the specified type, and then specify sort by Time
> Find. -name *.php|xargs Ls-alt
- This article is from: Linux Learning Network
LS Sort output file list by time