If you enjoyed this site, please consider donating $3. Any amount is appreciated. Thanks!

PowerShell as cmd.exe

Xah Lee, 2009-07

PowerShell provides many aliases that is similar to 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.exebashDescription
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
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
Get-Contentgc, type, cattypecatGet file content
Select-Stringfind, findstrgrepShow texts matching a pattern
env var Manipulation
Write-Outputecho, writeechoechoPrint strings, variables etc. to standard output
Set-Variablesv, setsetsetSet the value of a variable / create a variable
Process Management
Get-Processgps, pstlist, tasklistpsList all currently running processes
Stop-Processspps, killkill, taskkillkillStop a running process
Help Facilities
Clear-Hostcls, clearclsclearClear the screen
Get-Helphelp, manhelpmanHelp on commands
PowerShell CmdletPowerShell aliascmd.exebashDescription

Not Case Sensitive

PowerShell command are not case sensitive. “dir” is same as “DIR” or “DiR”; “Get-ChildItem” is the same as “get-childITEM”.

2009-07
© 2009 by Xah Lee.