powershell command (cp, list, rename, find, count)


- outline
basic command for Windows Power Shell
- example
List of files ending with txt
Get-ChildItem *txtSave list of files ending with wav to wavlist.txt
Get-ChildItem -filter *wav > wavlist.txt
Change file name
Change file name ending with txt to file name ending with log
Get-ChildItem *txt | Rename-Item -NewName { $_.Name -Replace 'txt', 'wav'}count files ending with json
(Get-ChildItem -filter *json | Measure-Object).CountNumber of files in current folder
(Get-ChildItem -Recurse -File | Measure-Object).CountNumber of files ending with .mp3
Get-ChildItem "." -Filter *.mp3 -Recurse | Measure-ObjectRemoving files ending with .ogg
Get-ChildItem "." -Filter *.ogg -Recurse | Remove-ItemRemoving files ending with .ogg with force option
Get-ChildItem "." -Filter *.ogg -Recurse | Remove-Item -force
- reference
Subscribe to my newsletter
Read articles from Taegu Kang directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
