LS Sort output file list by time

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.