Window Terminal的安装、常见命令

    WIndow Terminal原先是Window内部的一个项目,在2017年时,微软将其在GitHub开源,地址为: https://github.com/microsoft/terminal,用于替代Window老旧的DOS黑框框窗口。它支持Tab标签页、Emoj表情文字、检验文件的MD5值等功能。这里介绍其安装方法与常见命令。

1、安装Windows Terminal

    在2015年7月,微软发布了windows 10,接着,在2021年10月,微软发布了windows 11。
    Window Terminal主要支持Win10、Win11系统,因此它有2个版本:Windows Terminal for win10、Windows Terminal for win11。

    下载之后,保持连网状态,用管理员方式运行该安装文件,一路点击默认,直到安装完成。

2、常见命令

    Window Terminal是一个套在 CMD、Powershell、Windows Subsystem for Linux(WSL)这三者之上的一个界面更加漂亮、功能更加强大的终端工具。严格来说,它是套在 CMD 、Powershell 之上的一个终端。
    Windows Terminal软件统一了CMD和Powershell。因此,有2种模式,一种是CMD模式,另一种是PowerShell模式。在黑框框里,输入cmd则进入CMD模式,输入powershell则切换到Powershell模式。

2.1 CMD里的常用命令

在黑框框里,输入如下命令,即可切换到CMD模式

cmd

CMD里常用的命令如下:

含义 具体命令
进入hello目录 cd hello
浏览当前目录 start .
启动QQ.exe 进入到QQ所在的安装\bin目录,然后 start QQ.exe
5分钟后自动关机 shutdown /s /t 300 (300秒就是5分钟)
查看当前目录树 tree /f
新建hello文件夹 md hello
查看8080端口对应的进程ID netstat -ano | findstr “8080”
获取进程ID=1050的进程名称 tasklist | findstr “1050”
ping百度 ping www.baidu.com
查看本地IP ipconfig /all
## 1) 进入hello目录
cd hello

## 2) 浏览当前目录
start .

## 3) 启动QQ.exe
cd /d "c:\Program Files (x86)\Tencent\QQ\Bin"
start QQ.exe

## 4) 5分钟后自动关机
shutdown /s /t 300

## 5)查看当前目录树
tree /f

## 6) 新建hello文件夹
md hello

## 7) 查看8080端口对应的进程ID
netstat -ano|findstr "8080"

## 8)获取进程ID=1050的进程名称
tasklist|findstr "1050"

## 9) ping百度
ping www.baidu.com

## 10) 查看本地IP
ipconfig /all

2.2 PowerShell里常用的命令

在黑框框里,输入如下命令,即可切换到PowerShell模式

powershell
含义 具体命令
查看历史命令 history
查看QQ进程 ps QQ
屏幕清空 cls
查看系统版本 wmic os get caption
查看系统位数 wmic os get osarchitecture
关闭电脑 Stop-Computer
重启电脑 Restart-Computer
查看hello.txt文件的SHA256 Get-FileHash -Path .\hello.txt | Format-List
查看hello.txt文件的SHA1 Get-FileHash -Path .\hello.txt -Algorithm SHA1 | Format-List
查看hello.txt文件的MD5 Get-FileHash -Path .\hello.txt -Algorithm MD5 | Format-List
## 1) 查看历史命令
history

## 2)查看QQ进程
ps QQ

## 3) 屏幕清空
cls

## 4) 查看系统版本
wmic os get caption

## 5)查看系统位数
wmic os get osarchitecture

## 6)关闭电脑
Stop-Computer

## 7)重启电脑
Restart-Computer

## 8) 查看hello.txt文件的SHA256值
Get-FileHash -Path .\hello.txt| Format-List

## 9) 查看hello.txt文件的SHA1值
Get-FileHash -Path .\hello.txt -Algorithm SHA1 | Format-List

## 10) 查看hello.txt文件的MD5值
Get-FileHash -Path .\hello.txt -Algorithm MD5 | Format-List

    如图(1)、图(2)所示:

图(1)使用PowerShell查看进程、系统版本、系统位数

图(2) 使用PowerShell查看文件的sha256、SHA1、MD5值

附录

【1】 Github: Window Terminal官网
【2】 Github: Window Powershell官网

猜你喜欢

转载自blog.csdn.net/sanqima/article/details/127471211