[cs631apue] [CS631] -c,u,t,l Flags

Jan Schaumann jschauma at stevens.edu
Fri Oct 5 11:02:29 EDT 2012


tparisi <tparisi at stevens.edu> wrote:

> I have a quick question about the flags c,u,t and l.  If just the c flag 
> is specified, is our ls supposed to sort the file listing or does it only 
> sort if the -t flag is specified?

When '-c' is specified, you should:

- sort by ctime if '-t' was given
- print ctime if '-l' was given

If neither '-t' nor '-l' was given, then '-c' has no effect.

Similarly for '-u'.

> Also when the "l" flag is specified with the "c" flag, only the time
> is changed to to the access time but the output is not sorted based on
> the access time.  However if the "-ctl" flags are specified then the
> long listing format is sorted by the access time.  Am I correct in
> thinking this?

If all three of '-c', '-t', and '-l' are sorted then all three are in
effect.  That is, output is sorted by ctime and the times printed are
the ctimes.

Similarly for '-u'.

-Jan


More information about the cs631apue mailing list