Windows Powershell

应用场景:Windows电脑 + Android开发

Windows: cmd --> Powershell

Linux: bash scripts


cmd: bat scripts (xxx.bat)

powershell: cmdlet (xxx.ps1)

alias命令: Get-Alias (不区分大小写)

  • 管道符 |

  • Get-Command

  • Update-Help

  • Get-Help Get-Command

和Linux相同的命令:

  • pwd
  • ls
  • clear
  • cat
  • mkdir
  • mv
  • cp
  • rm

alias别名

除了Powershell 自身的alias外,我们还可以手动写alias, 比如将Linux上常用的grep命令

编辑Microsoft.PowerShell_profile.ps1 通常位于:C:\Users\你的用户名\Documents\PowerShell\Microsoft.PowerShell_profile.ps1

Set-Alias -Name which -Value Get-Command
Set-Alias -Name grep -Value Select-String

其他问题

posted @ 2025-09-07 22:22  梦一场6688  阅读(39)  评论(0)    收藏  举报