On 08/10/2013 08:40 AM, Michael Rasmussen wrote:
> On Sat, Aug 10, 2013 at 09:30:56AM -0500, David Fleck wrote:
>>> On 08/08/2013 06:47 PM, John Jason Jordan wrote:
>>>> Is there a way to do a ls command and have it sort by date of creation?
>> Try
>>
>> ls -lrt
> Creation?
>
> That isn't available in contemporary *nix, including Linuxes.
>
> ctime https://en.wikipedia.org/wiki/Stat_(Unix)
>
> ctime originally meant creation time,[8] however it has since been
> used almost always to refer to change time. It is updated any time
> file content changes (together with mtime), and also by changes in
> metadata such as file permissions, file ownership, and creation and
> deletion of hard links. In some implementations, ctime is affected by
> renaming a file (both original Unix and modern Linux tend to do this).
>
> Unlike atime and mtime, ctime cannot be set to an arbitrary value
> with utime() (as used e.g. by touch). Instead, when utime() is used,
> the ctime value is set to the current time.
>
> And this is confirmed by `man 2 stat`
>
> All of these system calls return a stat structure, which contains the
> following fields:
>
> struct stat {
> dev_t st_dev; /* ID of device containing file */
> ino_t st_ino; /* inode number */
> [ other stuff snipped ]
> time_t st_atime; /* time of last access */
> time_t st_mtime; /* time of last modification */
> time_t st_ctime; /* time of last status change */
> };
>
>
Fedora 19 provides the following 'ls' command
ls -ltcr
-r reverse (newest last in the list)
-c with -lt: sort by, and show, ctime (time of last modification
of file
status information) with -l: show ctime and sort by name
otherwise:
sort by ctime, newest first
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug