|
1 | 1 | ---
|
2 |
| -ms.date: 06/05/2017 |
| 2 | +ms.date: 09/09/2019 |
3 | 3 | keywords: powershell,cmdlet
|
4 | 4 | title: Appendix 1 Compatibility Aliases
|
5 | 5 | ---
|
6 | 6 | # Appendix 1 - Compatibility Aliases
|
7 | 7 |
|
8 |
| -Windows PowerShell has several transition aliases that allow UNIX and Cmd users to use familiar command names in Windows PowerShell. The most common aliases are shown in the table below, along with the Windows PowerShell command behind the alias and the standard Windows PowerShell alias if one exists. |
| 8 | +PowerShell has several aliases that allow **UNIX** and **cmd.exe** users to use familiar commands. |
| 9 | +The commands and their related PowerShell cmdlet and PowerShell alias are shown in the following |
| 10 | +table: |
9 | 11 |
|
10 |
| -You can find the Windows PowerShell command that any alias points to from within Windows PowerShell by using the Get-Alias cmdlet. For example, type **get-alias cls**. |
| 12 | +|cmd.exe command|UNIX command|PowerShell cmdlet|PowerShell alias| |
| 13 | +|---------------|----------------|--------------|------------| |
| 14 | +|**cls**|**clear**|`Clear-Host` (function)|`cls`| |
| 15 | +|**copy**|**cp**|`Copy-Item`|`cpi`| |
| 16 | +|**dir**|**ls**|`Get-ChildItem`|`gci`| |
| 17 | +|**type**|**cat**|`Get-Content`|`gc`| |
| 18 | +|**move**|**mv**|`Move-Item`|`mi`| |
| 19 | +|**md**|**mkdir**|`New-Item`|`ni`| |
| 20 | +|**pushd**|**pushd**|`Push-Location`|`pushd`| |
| 21 | +|**popd**|**popd**|`Pop-Location`|`popd`| |
| 22 | +|**del**, **erase**, **rd**, **rmdir**|**rm**|`Remove-Item`|`ri`| |
| 23 | +|**ren**|**mv**|`Rename-Item`|`rni`| |
| 24 | +|**cd**, **chdir**|**cd**|`Set-Location`|`sl`| |
| 25 | + |
| 26 | +To find the PowerShell aliases, use the [Get-Alias](/powershell/module/Microsoft.PowerShell.Utility/Get-Alias) |
| 27 | +cmdlet. To display a cmdlet's aliases, use the **Definition** parameter and specify the cmdlet name. |
| 28 | +Or, to find an alias's cmdlet name, use the **Name** parameter and specify the alias. |
11 | 29 |
|
| 30 | +```powershell |
| 31 | +Get-Alias -Definition Get-ChildItem |
12 | 32 | ```
|
13 |
| -CommandType Name Definition |
14 |
| ------------ ---- ---------- |
15 |
| -Alias cls Clear-Host |
| 33 | + |
| 34 | +```Output |
| 35 | +CommandType Name |
| 36 | +----------- ---- |
| 37 | +Alias dir -> Get-ChildItem |
| 38 | +Alias gci -> Get-ChildItem |
| 39 | +Alias ls -> Get-ChildItem |
16 | 40 | ```
|
17 | 41 |
|
18 |
| -|CMD Command|UNIX Command|PS Command|PS Alias| |
19 |
| -|---------------|----------------|--------------|------------| |
20 |
| -|**dir**|**ls**|**Get-ChildItem**|**gci**| |
21 |
| -|**cls**|**clear**|**Clear-Host** (function)|**cls**| |
22 |
| -|**del, erase, rmdir**|**rm**|**Remove-Item**|**ri**| |
23 |
| -|**copy**|**cp**|**Copy-Item**|**ci**| |
24 |
| -|**move**|**mv**|**Move-Item**|**mi**| |
25 |
| -|**rename**|**mv**|**Rename-Item**|**rni**| |
26 |
| -|**type**|**cat**|**Get-Content**|**gc**| |
27 |
| -|**cd**|**cd**|**Set-Location**|**sl**| |
28 |
| -|**md**|**mkdir**|**New-Item**|**ni**| |
29 |
| -|**pushd**|**pushd**|**Push-Location**|**pushd**| |
30 |
| -|**popd**|**popd**|**Pop-Location**|**popd**| |
| 42 | +```powershell |
| 43 | +Get-Alias -Name gci |
| 44 | +``` |
| 45 | + |
| 46 | +```Output |
| 47 | +CommandType Name |
| 48 | +----------- ---- |
| 49 | +Alias gci -> Get-ChildItem |
| 50 | +``` |
0 commit comments