});

DOS/PS commands

windows cmd or powershell

Personal note

if you also have python experience, some helpful analogs are:

pythonPS(powershell)
variablesvar$var
for loopfor i in ls: …foreach($i in $ls){ … }

File management

rename with PS

Replace the same section of strings with Powershell.
Ref: {StackExchange}

Ref: {Link}

or a more linux way, thanks to the aliases in powershell

A demo of for loop and if statement

  • $(var_name) to specify variables
  • | is pipeline, measure return number of rows, similar to count
  • powershell comparison operators: -eq is equal and -ne not equal
  • foreach syntax: foreach(condition){operations}
  • if syntax, if(condition){statement}

Zip & Unzip

powershell

similarly, to zip, use Compress_archive command as

dos with 7zip

When unzipping 7z files but do not have permission to install, one can use 7zr.exe {Download Link}.
But one must call it with full directory. I tried doskey that claims to resemble ‘alias’ in linux, but it returns help docs only.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.