PowerShell as cmd.exe or Bash

, ,

PowerShell provides many aliases that emulates cmd.exe or Bash. So, if you are familiar with cmd.exe or bash, you can start using PowerShell as replacement. Here's a table showing some of the equivalent commands:

Path Manipulation
PowerShell CmdletPowerShell aliascmd.exebashPurpose
Set-Locationsl, cd, chdircd, chdircdChange dir
Get-Locationgl, pwdcdpwdShow current dir
Get-ChildItemgci, dir, lsdirlsList current dir content
Push-LocationpushdpushdpushdSave current path to stack
Pop-LocationpopdpopdpopdChange to last pushed dir
File Manipulation
PowerShell CmdletPowerShell aliascmd.exebashPurpose
Copy-Itemcpi, copy, cpcopycpCopy file or dir
Remove-Itemri, del, erase, rmdir, rd, rmdel, erase, rmdir, rdrm, rmdirDelete file or dir
Rename-Itemrni, renren, renamemvRename file or dir
Move-Itemmi, move, mvmovemvMove file or dir
Text Processing
PowerShell CmdletPowerShell aliascmd.exebashPurpose
Get-Contentgc, type, cattypecatGet file content
Select-Stringfind, findstrgrepShow texts matching a pattern
env var Manipulation
PowerShell CmdletPowerShell aliascmd.exebashPurpose
Write-Outputecho, writeechoechoPrint strings, variables etc. to standard output
Set-Variablesv, setsetsetSet the value of a variable / create a variable
Process Management
PowerShell CmdletPowerShell aliascmd.exebashPurpose
Get-Processgps, pstlist, tasklistpsList all currently running processes
Stop-Processspps, killkill, taskkillkillStop a running process
Help Facilities
PowerShell CmdletPowerShell aliascmd.exebashPurpose
Clear-Hostcls, clearclsclearClear the screen
Get-Helphelp, manhelpmanHelp on commands

Not Case Sensitive

PowerShell command names are not case sensitive. “Get-ChildItem” = “get-childitem”.

blog comments powered by Disqus
2009-07