Find files modified in the last 24 hours
Build a paste-ready command, then review its compatibility and effects before running it.
Get-ChildItem . -File -Recurse | Where-Object LastWriteTime -gt (Get-Date).AddDays(-1)read-onlyno known side effects Compatibility
WindowsVerified for Windows using powershell syntax.
Operational knowledgereview due 2027-01-19
RequirementsGet-ChildItemGet-ChildItem must be installed and available on PATH.
Version supportGet-ChildItem Current supported releasesVerified for windows using powershell syntax; consult compatibility notes for platform-specific differences.
Expected signalsDirectory: C:\Logs\webRepresentative successful output; values vary with the selected target and system state.
Known errorsGet-ChildItem: command not foundGet-ChildItem is missing or is not available on PATH.
VerifyGet-ChildItem {{folder}} -File -Recurse | Where-Object LastWriteTime -gt (Get-Date).AddDays(-1)The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01Get-ChildItemCommandRuns the Get-ChildItem stage of this one-liner.
02<folder>ParameterA value supplied in the Fill parameters section.
03-FileOptionConfigures Get-ChildItem with the -File option.
04-RecurseOptionConfigures Get-ChildItem with the -Recurse option.
05|PipelinePasses the output on the left to the command on the right.
06Where-ObjectCommandRuns the Where-Object stage of this one-liner.
07LastWriteTimeArgumentPasses LastWriteTime to Where-Object.
08-gtOptionConfigures Where-Object with the -gt option.
09(Get-Date).AddDays(-1)ArgumentPasses (Get-Date).AddDays(-1) to Where-Object.
Example input
Get-ChildItem C:\Logs -File -Recurse | Where-Object LastWriteTime -gt (Get-Date).AddDays(-1)
Example output
Directory: C:\Logs\web
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 23.07.2026 10:40 284998451 access.log
-a--- 23.07.2026 10:39 8421192 error.log
Illustrative output — exact values vary by system and data.
Official sources