Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to sort the files according to the time stamp in unix? [closed]

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.

like image 374
Srihari Avatar asked May 16 '11 21:05

Srihari


People also ask

How do I sort files by time?

All you need to do is right-click on the headings and select Date Taken, you can then sort on it, it includes the time. Now it will always sort in date/time order.

How do you sort files by date modified in Unix?

In order to ls by date or list Unix files in last modifed date order use the -t flag which is for 'time last modified'. or to ls by date in reverse date order use the -t flag as before but this time with the -r flag which is for 'reverse'.

How do I sort files by date?

Click the sort option in the top right of the Files area and select Date from the dropdown. Once you have Date selected, you will see an option to switch between descending and ascending order.


1 Answers

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.

like image 50
ninjalj Avatar answered Sep 21 '22 13:09

ninjalj