Skip to content
shellmap

findLocate files by name, size, time, or other attributes across all 5 shells

Equivalents in every shell

Bashunix
find . -name "*.log"
Zshunix
find . -name "*.log"

Or use Zsh recursive glob: `print -l **/*.log`.

Fishunix
find . -name "*.log"
PowerShellwindows
Get-ChildItem -Recurse -Filter *.log

For complex predicates pipe to `Where-Object`.

cmd.exewindows
dir /s /b *.log

`/s` recurses, `/b` outputs bare paths.

Worked examples

Find files modified in the last day

Bash
find . -mtime -1
PowerShell
Get-ChildItem -Recurse | Where-Object { $_.LastWriteTime -gt (Get-Date).AddDays(-1) }
cmd.exe
forfiles /s /d -1 /c "cmd /c echo @path"

Find files larger than 100MB

Bash
find . -size +100M
PowerShell
Get-ChildItem -Recurse | Where-Object { $_.Length -gt 100MB }

Find and delete files by pattern

Bash
find . -name "*.tmp" -delete
PowerShell
Get-ChildItem -Recurse -Filter *.tmp | Remove-Item
cmd.exe
del /s *.tmp

Gotchas

  • Confusingly, Windows has its own `find` command that searches *within* files (like grep), not for files. Use `where` or `dir /s` for filename search.
  • `Get-ChildItem -Filter` is much faster than `-Include` because filtering happens at the provider level.
  • GNU find supports `-printf`; BSD find (macOS pre-Sonoma) does not — use `-print` and `awk` for formatting.

WSL & PowerShell Core notes

pwshPowerShell has no Unix-style `find` cmdlet — `Get-ChildItem -Recurse | Where-Object { ... }` is the closest cross-platform equivalent and works identically on Windows pwsh and pwsh on Linux/macOS. On Linux/macOS pwsh the GNU `find` binary is still in PATH and takes precedence in plain calls.
WSLRunning `find /mnt/c/...` from WSL traverses NTFS through DrvFs and is significantly slower than scanning the Linux filesystem. For pure filename matching on Windows files, `cmd.exe /c "dir /s /b path\*.log"` invoked from WSL can be faster than `find`.

Common tasks using find

Related commands