PowerShell as cmd.exe or Bash

Perm url with updates: http://xahlee.org/powershell/commands.html

PowerShell as cmd.exe or Bash

Xah Lee, 2009-07

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 commands are not case sensitive. “dir” is same as “DIR” or “DiR”; “Get-ChildItem” is the same as “get-childitem” or “get-childITEM”.

Popular posts from this blog

11 Years of Writing About Emacs

does md5 creates more randomness?

Google Code shutting down, future of ErgoEmacs