Windows CLI one liner:
FOR /R "c:\path\to\directory" %I IN (*.gz) DO del "%I"
Just iterates recursively over the given directory, and in this case just the .gz files, and deletes them.
Windows CLI one liner:
FOR /R "c:\path\to\directory" %I IN (*.gz) DO del "%I"
Just iterates recursively over the given directory, and in this case just the .gz files, and deletes them.
Another one liner, but for Windows CLI:
FOR /R "C:\path\to\directory" %I IN (*.gz) DO "c:\Program Files\7-Zip\7z.exe" x "%I" -aou -o"%~dpI"
This requires z-Zip to be installed. The gz could be altered to another compressed file extension.
The title says it all. It’s incredibly simple:
gci | %{$_.LastWriteTime = date}
gci is shorthand for Get-ChildItem, and % is shorthand for ForEach-Object. $_ refers to the current element being iterated over. Date returns the current date (and time).
The script therefore gets all items (in the context of the current directory) and updates the LastWriteTime for them all to the current date. Sorted.