With zsh you don't need to use find, fd, or any other external tool.
zsh's built-in globbing features can be used instead.
- Find all files modified in the last 90 minutes
print -l **/*(mm-90)
- Find all files and do something to each one
print -l **/*(mm-90) | xargs ls -l
- Find all files modified before 2 days ago
print -l **/*(m+2)
- Removing files older than 7 days
zargs -- **/*(m+7) -- rm
- Find all files modified after last 2 days
print -l **/*(m-2)
- Find all files modified at the last 2 day mark
print -l **/*(m2)
In most of the above examples "print -l" is used to print the results to the terminal, but you can instead use whatever command you want (as in the "rm" example above).
The zsh rm command doesn't with too many (say, 100 000) files, execve() fails with: Argument list too long. This works and it is relatively fast (runs rm in big batches): find ... | xargs -d '\n' rm --
zsh's built-in globbing features can be used instead.
In most of the above examples "print -l" is used to print the results to the terminal, but you can instead use whatever command you want (as in the "rm" example above).Many more examples and tips can be seen here: [1]
[1] - http://www.zzapper.co.uk/zshtips.html