[cs631apue] Sorting By Time?

Jan Schaumann jschauma at stevens.edu
Tue Oct 13 17:05:23 EDT 2015


Patrick Murray <pmurray1 at stevens.edu> wrote:
> Are the -c, -u, -t options intended to modify the sorted order of entries,
> or are they simply for alternative time output?

The manual page provided to you should be sufficiently specific:

-c  Use time when file status was last changed, instead of time of
    last modification of the file for sorting (-t) or printing (-l)

-t  Sort by time modified (most recently modified first) before sorting
    the operands by lexicographical order.

-u  Use time of last access, instead of last modification of the file
    for sorting (-t) or printing (-l)

Compare to what the system's ls(1) does, and the requirement should
become clear.

-Jan


More information about the cs631apue mailing list