Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I list files according to the last time they were accessed?

So far I haven't seen a command that can list them by time.

I need it to display files that have been last accessed last December, if that helps any.

share|improve this question
    
Hang on, do you really mean access or modification time? –  terdon Jul 6 '13 at 14:24

1 Answer 1

I am not sure this is possible. In theory both ls and find are quite capable of sorting or finding by access time. The problem is that since kernel version 2.3.60, the default options for filesystem mounting include noatime:

   noatime
          Do not update inode access  times  on  this  filesystem
          (e.g.,  for faster access on the news spool to speed up
          news servers).

If your disks are mounted using the default options, the access time will not be modified when a file is accessed so the information you need to find by access time will not be present on your system. See this question on U&L.SE for more information.

share|improve this answer
    
Looks like you're right, I pulled up an outdated VM to try it on. Thanks for the tip. –  nerdwaller Apr 17 '13 at 17:50
1  
@nerdwaller no worries, I was about to upvote you when I tested and saw id did not work. I was intrigued enough to go look up why :). –  terdon Apr 17 '13 at 17:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.