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 Cmdlet | PowerShell alias | cmd.exe | bash | Description |
|---|---|---|---|---|
| Set-Location | sl, cd, chdir | cd, chdir | cd | Change dir |
| Get-Location | gl, pwd | cd | pwd | Show current dir |
| Get-ChildItem | gci, dir, ls | dir | ls | List current dir content |
| Push-Location | pushd | pushd | pushd | Save current path to stack |
| Pop-Location | popd | popd | popd | Change to last pushed dir |
| File Manipulation | ||||
| Copy-Item | cpi, copy, cp | copy | cp | Copy file or dir |
| Remove-Item | ri, del, erase, rmdir, rd, rm | del, erase, rmdir, rd | rm, rmdir | Delete file or dir |
| Rename-Item | rni, ren | ren, rename | mv | Rename file or dir |
| Move-Item | mi, move, mv | move | mv | Move file or dir |
| Text Processing | ||||
| Get-Content | gc, type, cat | type | cat | Get file content |
| Select-String | ◇ | find, findstr | grep | Show texts matching a pattern |
| env var Manipulation | ||||
| Write-Output | echo, write | echo | echo | Print strings, variables etc. to standard output |
| Set-Variable | sv, set | set | set | Set the value of a variable / create a variable |
| Process Management | ||||
| Get-Process | gps, ps | tlist, tasklist | ps | List all currently running processes |
| Stop-Process | spps, kill | kill, taskkill | kill | Stop a running process |
| Help Facilities | ||||
| Clear-Host | cls, clear | cls | clear | Clear the screen |
| Get-Help | help, man | help | man | Help on commands |
| PowerShell Cmdlet | PowerShell alias | cmd.exe | bash | Description |
PowerShell command are not case sensitive. “dir” is same as “DIR” or “DiR”; “Get-ChildItem” is the same as “get-childITEM”.