Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Sort Files by Date on Mac: Finder & Terminal

· 6 min read · Home Tech

In this article
  1. Why Sorting by Date Matters on macOS
  2. How to Sort by Date in Finder
  3. Making the Sort Stick (Default Sort Order)
  4. Sorting by Date in Terminal (Command Line)
  5. Common Problems and Fixes
  6. How to Choose the Right Date to Sort By
  7. Frequently Asked Questions

To sort files by date on a Mac, open the folder in Finder, click the "Date Modified" column header to sort by that date, or right-click the column header area to add "Date Created", "Date Last Opened", or "Date Added" columns and then click any of those headers. For more control, you can also use the Terminal with the ls -lt command to list files by modification time.

Why Sorting by Date Matters on macOS

macOS gives you several different "dates" for each file, and choosing the right one is the difference between finding what you need and staring at a wall of similarly named files. The most common dates are:

  • Date Modified – when the file's content was last changed. This is the default and usually the most useful.
  • Date Created – when the file was first saved to the disk.
  • Date Last Opened – when you last opened the file (this is only tracked for some files and can be disabled in Finder preferences).
  • Date Added – when the file was added to the current folder (this is a Spotlight metadata field, not a filesystem attribute).

Most people mean "Date Modified" when they say "sort by date," but if you're organizing photos or downloaded files, "Date Created" might be more meaningful. The Finder lets you sort by any of these columns, but you have to add the columns first.

How to Sort by Date in Finder

The quickest way to sort by date in a Finder window is to switch to List view and click a column header. Here's the step-by-step:

  1. Open the folder you want to sort in Finder.
  2. Click the List view icon in the toolbar (it looks like a list with lines).
  3. Look at the column headers at the top of the file list. If you see "Date Modified", click it once to sort ascending (oldest first), click again to sort descending (newest first).
  4. If you don't see a "Date Modified" column, right-click (or Control-click) on any column header. A menu of available columns appears. Check "Date Modified", "Date Created", "Date Last Opened", or "Date Added" as needed.
  5. Click the header of the date column you want to sort by.

If you prefer Icon or Gallery view, you can still sort by date: go to the View menu in the menu bar, hover over Sort By, and choose a date option. This sets the sort order for that folder.

Making the Sort Stick (Default Sort Order)

By default, Finder remembers the sort order for each folder individually. If you want every folder to sort by date automatically, you can set a global default:

  1. Open a Finder window.
  2. Go to Finder > Settings (or Preferences in older macOS).
  3. Click the Advanced tab.
  4. Check the box that says "Keep folders on top" if you want folders to stay above files when sorting.
  5. Close the settings. Now go to View > Sort By and choose your desired date option while holding the Option key. This sets the default for all folders that haven't been customized.

Note: If a folder already has a custom sort order, the global default won't override it until you reset that folder's view options.

Sorting by Date in Terminal (Command Line)

For power users, the Terminal gives you more flexibility. Open Terminal (found in /Applications/Utilities/) and navigate to the folder you want to sort. Then use:

  • ls -lt – lists files sorted by modification time, newest first.
  • ls -lt -r – reverse order (oldest first).
  • ls -lt --time-style=long-iso – shows the date in a full YYYY-MM-DD format.
  • ls -ltU – sorts by creation time (on macOS, -U uses birth time).

To list only files (not directories), add -p and filter, or use find with -type f. For example, to show the 10 newest files in the current folder:

ls -lt | head -10

This is especially handy when you're scripting or need to see the exact timestamps, which the Finder doesn't show by default.

Common Problems and Fixes

Several issues can make sorting by date seem broken:

  • Date Modified doesn't change when you move a file. That's normal – moving a file doesn't modify its content. If you want to see when you added it to a folder, use "Date Added" instead.
  • Date Created is earlier than Date Modified. This is expected for files that have been edited. It can also happen if you copied a file from another disk – the creation date is preserved by default.
  • Sorting resets when you reopen the folder. This happens if the folder is set to "Use Groups" or if you have a custom sort order that doesn't include a date column. Check View > Sort By and make sure it's set to a date option, not "None".
  • Date Added column is missing. Right-click the column header and add it. It's not there by default because it's a Spotlight metadata field, not a filesystem attribute.
  • Photos or downloads don't sort by the date you expect. Some apps (like Photos) manage their own library and don't respect Finder sort order. You may need to export files first.

How to Choose the Right Date to Sort By

Here's a quick guide to picking the right date for your task:

  • Finding a file you just edited – use Date Modified.
  • Finding a file you just downloaded – use Date Added (or Date Created, but Added is more accurate for downloads).
  • Organizing photos by when they were taken – use Date Created (though the EXIF date might be more accurate for photos).
  • Finding a file you opened yesterday – use Date Last Opened.

If you're not sure, Date Modified is the safest bet because it's updated every time you save changes, and it's the only date that's always reliable.

Frequently Asked Questions

How do I sort by date on a Mac without using the mouse?

You can use keyboard shortcuts in Finder: press Command+2 to switch to List view, then use the Tab key to navigate to the column header and press Space to cycle through sort options. Alternatively, open Terminal and use ls -lt.

Why is my file's "Date Modified" older than the "Date Created"?

This can happen if you copied the file from a source that had an older modification date, or if the file was created on a different system with a clock skew. It's not a problem – the system just records what the filesystem says.

Can I sort by date in the "Recents" smart folder?

Yes, the Recents folder is just a smart folder. You can sort it by any column just like a regular folder. To change the sort, go to View > Sort By and choose a date option.

How do I sort by date in the "Downloads" folder on a Mac?

Open the Downloads folder in Finder, switch to List view, and click the "Date Added" column header. That's the most accurate for downloads. If you don't see that column, right-click the header and add it.

Does sorting by date in Finder affect the actual file order on disk?

No, sorting only changes how files are displayed. The filesystem order is independent of the view order. This is true for all file managers.