I want to delete all the files when the first two characters are equal to zz
or ZZ
. How can I do it?
The command line uses something called globbing. * is a wildcard for any string of characters. So by running rm *. log you are saying remove all files that end with .
To delete matching files: enter *_bad. jpg in the search box, select the results and press Delete or Del.
You need to use the rm command to remove the files specified on the command line. You need to use bash special feature called globbing (a “wildcard”) for filename expansion.
In PowerShell, the Remove-Item cmdlet deletes one or more items from the list. It utilizes the path of a file for the deletion process. Using the “Remove-Item” command, you can delete files, folders, variables, aliases, registry keys, etc.
Get all objects (including hidden, recursively) from a path with names starting with 'zz', filter out directory objects and delete the items.
Get-ChildItem <path> -Recurse -Force -Filter zz* | Where-Object {!$_.PSIsContainer} | Remove-Item
This works for me:
Remove-Item zz*
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With