What is the difference between
-t options for the
ls Unix command? And how can I sort by date of creation with the
-t lists the file's modification time, which is the last time the file's content was modified (unless the modification time was explicitly set afterwards).
-c lists the file's inode change time, which is the last time the file's metadata was changed (ownership, permissions, etc.) or the file was moved.
Most unix systems do not track the creation date of a file, so most
ls implementations don't offer a way to sort by this non-existent timestamp. Under OSX, use
See also How do I do a ls and then sort the results by date created? for more information.
From the GNU manpage
-t sort by modification time, newest first -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
-c is used with
-lt, it will show and sort by file ctimes (instead of modification times). Whether or not your OS records file ctime's depends on the filesystem being used.