美文网首页
PowerShell 的常用命令记录

PowerShell 的常用命令记录

作者: changhr2013 | 来源:发表于2019-04-17 14:11 被阅读0次
  • 清屏
cls
  • 打开当前目录的资源管理文件夹
ii .
  • 获取当前目录的全路径
$ExecutionContext.SessionState.Path.CurrentFileSystemLocation
or
(gi .).FullName
or
($pwd).Path
or
Resolve-Path '.'
or
Get-Location
  • 创建一个新的文件
New-Item newFile.txt
or
ni newFile.txt
  • 复制一个文件
Copy-Item file.txt copyFile.txt
or
copy file.txt copyFile.txt
or
cp file.txt copyFile.txt
  • 移动一个文件
Move-Item file.txt -Destination D:\target\
or
move file.txt -Destination D:\target\
or
mv file.txt -Destination D:\target\
  • 查看端口号被占用情况
netstat -ano | findstr 8080
  • 通过 pid 查找进程
tasklist | findstr 12345
  • 通过 pid 强制结束进程
taskkill /F /PID 12345

相关文章

网友评论

      本文标题:PowerShell 的常用命令记录

      本文链接:https://www.haomeiwen.com/subject/opfnwqtx.html