Total Views: windows系统的终端
环境变量的增删改查
cmd
1
2
3
4
5
| set
set Path
set Path=xxx
set Path=xxx;%Path%
|
windows powershell
1
2
3
4
5
6
7
8
| ls env:
$env:MY_VAR
Get-Command -Name node -All
$env:MY_VAR = "InitialValue"
$env:MY_VAR = "InitialValue;$env:MY_VAR"
$env:PYTHONPATH = "$env:PYTHONPATH;$(Get-Location)"
rm env:MY_VAR
|
自动关联系统默认程序,快速打开
额外配置
自定义 powershell
编辑
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| # 默认的别名
# Set-Alias pwd Get-Location
# Set-Alias ls Get-ChildItem
# Set-Alias cd Set-Location
# Set-Alias cat Get-Content
# Set-Alias cp Copy-Item
# Set-Alias rm Remove-Item
# Set-Alias mv Move-Item
# Set-Alias mkdir New-Item -ItemType Directory
# Set-Alias -Name clear -Value Clear-Host
# Set-Alias -Name history -Value Get-History
# Set-Alias -Name which -Value Get-Command
# 创建自定义函数
function touch {
param (
[string]$path
)
New-Item -ItemType File -Path $path -Force
}
# 进程/服务操作
Set-Alias -Name top -Value Get-Process
Set-Alias -Name kill -Value Stop-Process
# 网络操作
Set-Alias -Name ping -Value Test-Connection
Set-Alias -Name wget -Value Invoke-WebRequest
|
windows 命令行安装工具
winget
https://learn.microsoft.com/zh-cn/windows/package-manager/winget/help
windows port
https://blog.csdn.net/zt15732625878/article/details/80904437