1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 12:24:55 +02:00
tldr/pages/windows/forfiles.md
2019-08-22 12:37:57 +00:00

28 lines
588 B
Markdown

# forfiles
> Select one or more files to execute a specified command on.
> More information: <https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/forfiles>.
- Search for files in the current directory:
`forfiles`
- Search for files in a specific directory:
`forfiles /p {{path/to/directory}}`
- Run the specified command for each file:
`forfiles /c "{{command}}"`
- Search for files using a specific glob mask:
`forfiles /m {{glob_pattern}}`
- Search for files recursively:
`forfiles /s`
- Search for files older than 5 days:
`forfiles /d {{+5}}`