Aliases

suggest change

Remarks

PowerShell has strict rules for naming cmdlets (a Verb-Noun template; see [topic not yet created] for more information). It is not convenient to write Get-ChildItem every time you want to list files in a directory interactively.

Therefore PowerShell lets you use shortcuts, called aliases, instead of cmdlet names.

You can write ls, dir, or gci instead of Get-ChildItem and get the same result. An alias is equivalent to its cmdlet.

Some of the common aliases are:

Alias Cmdlet
%, foreach ForEach-Object
?, where Where-Object
cat, gc, type Get-Content
cd, chdir, sl Set-Location
cls, clear Clear-Host
cp, copy, cpi Copy-Item
dir, ls, gci Get-ChildItem
echo, write Write-Output
fl Format-List
ft Format-Table
fw Format-Wide
gl, pwd Get-Location
gm Get-Member
iex Invoke-Expression
ii Invoke-Item
mv, move Move-Item
rm, rmdir, del, erase, rd, ri Remove-Item
sleep Start-Sleep
start, saps Start-Process

gc is Get-Content, not Get-Location. In the table above, aliases also mimic commands from other shells (cmd and Bash), which makes them easier to discover.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents