Skip to content
shellmap

Find files modified today

List every file changed in the last 24 hours, recursively from the current directory.

How to find files modified today in each shell

Bashunix
find . -type f -mtime -1
Zshunix
find . -type f -mtime -1

Same external `find` binary as bash. Zsh adds glob qualifiers — `print -l **/*(.m-1)` is a built-in alternative.

Fishunix
find . -type f -mtime -1

Fish calls the system `find`; no built-in equivalent.

PowerShellwindows
Get-ChildItem -Recurse -File | Where-Object { $_.LastWriteTime -gt (Get-Date).AddDays(-1) }

`LastWriteTime` is the Windows equivalent of mtime. `CreationTime` is different — use it only if you really want ctime.

cmd.exewindows
forfiles /P . /S /D +0 /C "cmd /c if @isdir==FALSE echo @path"

`forfiles /D +0` matches **today's date**, not "the last 24 hours". For a 24h window use PowerShell.

Equivalents listed for Bash, Zsh, Fish, PowerShell, cmd.exe.

Gotchas & notes

  • `find -mtime -1` is the last 24 hours of **mtime** (modification). Switch to `-ctime -1` for inode changes or `-atime -1` for last access.
  • macOS / BSD `find` has the same `-mtime` flag as GNU `find`, but `-printf` and `-quit` are GNU-only — write portable scripts with `-print` + `head`.
  • PowerShell `Where-Object { $_.LastWriteTime -gt (Get-Date).AddDays(-1) }` compares against **right-now minus 24h**, which is closer to `-mtime -1` than `forfiles /D +0` is.
  • `forfiles` on Windows is the closest cmd-native equivalent, but its date filter is day-granular, not 24h-window — flag this when porting Unix scripts.

Related commands

Related tasks