How to sort the files according to the time stamp in unix?

UnixUnix Timestamp

Unix Problem Overview


How to sort the files according to the time stamp in unix? I need to sort the files and also based on time they created.

Unix Solutions


Solution 1 - Unix

File modification:

ls -t

Inode change:

ls -tc

File access:

ls -tu

"Newest" one at the bottom:

ls -tr

None of this is a creation time. Most Unix filesystems don't support creation timestamps.

Solution 2 - Unix

Use -t on ls. e.g:.

ls -tr

or

ls -ltr

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSrihariView Question on Stackoverflow
Solution 1 - UnixninjaljView Answer on Stackoverflow
Solution 2 - UnixlinutsView Answer on Stackoverflow