How to get help and find aliases of commands in Windows Powershell?

A command in Powershell can have one or many alias. An alias is the command but in a shorter and mostly abbreviated form. Some aliases are made to match bash commands.

 

Get-ChildItem

Amarkani waxa uu taxayaa content ee buugga shaqada hadda.
alias: ls, dir

 

Get-Alias

To find the alias of a command in Powershell use the Get-Alias amarka.

 

Tusaale ahaan, find all the aliases start with r
get-alias r*

 

The Get-Alias Amarka laftiisa ayaa alias ah gal. The following will do the same thing as above
gal r*

 

Get-Alias Waxa kale oo uu helo amarka buuxa ee alias ah
gal ls
Outputs: ls -> Get-ChildItem

 

We can also find all the aliases of the specified command with the -Definition parameter. Tusaale ahaan, let’s find all the aliases of the Get-ChildItem amarka. We use -d which is short for -Definition

gal -d get-childitem

Outputs

dir -> Get-ChildItem
gci -> Get-ChildItem
ls -> Get-ChildItem

 

Get-Command finds the commands by command name. Get-Command has the alias gcm. So we can do this
Hel cmdlets bilaabo karaa
gcm -c cmdlet get*

 

kor ku xusan waa la mid ah sida….
Get-Command -CommandType Cmdlet Get*

To get help on any of the aliases or commands, just type help in front of the command. Tusaale ahaan…

help cp

 

 

Leave a Reply