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 -1Zshunix
find . -type f -mtime -1Same external `find` binary as bash. Zsh adds glob qualifiers — `print -l **/*(.m-1)` is a built-in alternative.
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
- List files recursively— Print every file under a directory tree, optionally as a flat list of full paths.
- Delete files older than 30 days— Remove files whose last-modified time is more than 30 days ago, recursively.
- Find the largest files in a directory— Identify the top N largest files under a directory tree, sorted by size.