mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-06-06 06:26:02 +02:00
28 lines
508 B
Markdown
28 lines
508 B
Markdown
![]() |
# forfiles
|
||
|
|
||
|
> Select one or more files to execute a specified command on.
|
||
|
|
||
|
- 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 with a last-modified date greater than 5 days old:
|
||
|
|
||
|
`forfiles /d {{+5}}`
|