Is there any way to sort all files in a particular directory by date, even ones in subfolders? For example:

drive root -> documents -> mysite -> dev

Drive root contains a bunch of individual files, plus a folder called documents. Documents contains a bunch of files, plus a folder called mysite, and so on. What I want to see is just a list of files sorted by date, from all the folders, rather than having to open each folder separately and seeing only its files sorted by date.

I have Cocoatech's Pathfinder installed, so if it isn't possible in the standard Finder, maybe there's some way to do it in PF?

(If the folder tree were really as simple as my example, it wouldn't be an issue, but what I'm really looking at is a website's build directory, which contains about 5 levels of subdirectories, and I need to see all files sorted by date so that I can move whatever changed today (regardless of which folder it's in.)

2 Answers 2


If you don't mind using the terminal you could try this:

find . -type f -exec ls -lth {} +

This will list files from current directory and all directories below, sorted by modified date. A variant not listing modification date would be:

find . -type f -exec ls -t {} +

But I believe that it would be better to just list the files that have changed the last 1440 minutes

find . -mmin -1440

You could use spotlight to do this.

  1. In Finder, select the folder that contains everything.
  2. File -> Find or cmd+F
  3. Now, you need to do some sort of search or else nothing will show up. Pick something that all relevant files will satisfy, for example "Last modified date is within the last 100 years"
  4. If you aren't already doing so, view the results as a list (View -> as List or cmd+2)
  5. If there is no header that says "Date Modified" you can get one by going to (View -> Show View options) and selecting it in the "Show columns" category.
  6. Click the Date Modified column header to sort by this value.

One thing to consider: Folders also show up in the list. Perhaps you can get around this by requiring size to be greater than 0.

If for some reason spotlight is not working for you, you could do use a python script, like this one:

#! /usr/bin/python

import os, time

for path,dirs,files in os.walk("/path/to/folder"):
  for file in files:
    mtimestring=time.strftime("%Y-%m-%d %H:%M:%S",time.localtime(mtime))
    print "\"" + fullname + "\"," + mtimestring

Save the output to a .csv file and use your favorite spreadsheet program to do the sorting. Or you could alter the script to do the sorting for you.

  • OK, so I tried it and it worked for files that are actually on my physical hard drive, but did not work for files on a mounted share, which is what I need. Any ideas?
    – EmmyS
    May 27, 2011 at 14:01
  • You could always use a script of some kind. I edited to include a python example. May 28, 2011 at 19:34
  • Thanks. Seems kind of ridiculous that I'd have to resort to a script, but I'll give it a shot.
    – EmmyS
    May 31, 2011 at 15:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .