Windows使用记录

# 设置开机自启

  1. win+r
  2. 输入shell:startup
  3. 将程序快捷方式拖到弹出的文件夹

# 定时关机

shutdown -s -t 7200

# 找出占用端口并kill

# 查找端口占用
netstat -ano |findstr [端口]
# 查看进程信息
tasklist |findstr [进程号]
tasklist /FI "PID eq [进程号]"
# 结束进程
taskkill /f /t /im [进程名称]
tskill PID
1
2
3
4
5
6
7
8

# 快捷键

# 剪切板

wind+v

# 控制面板

wind+R输入control回车

# 角标处理

# 删除角标

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons" /v 29 /d "%systemroot%\system32\imageres.dll,197" /t reg_sz /f
taskkill /f /im explorer.exe
attrib -s -r -h "%userprofile%\AppData\Local\iconcache.db"
del "%userprofile%\AppData\Local\iconcache.db" /f /q
start explorer
pause
1
2
3
4
5
6

# 恢复角标

reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons" /v 29 /f
taskkill /f /im explorer.exe
attrib -s -r -h "%userprofile%\AppData\Local\iconcache.db"
del "%userprofile%\AppData\Local\iconcache.db" /f /q
start explorer
pause
1
2
3
4
5
6

# scoop

使用指南 (opens new window)

将 Scoop 安装到自定义目录 :

$env:SCOOP='D:\Scoop'
# 先添加用户级别的环境变量 SCOOP
[environment]::setEnvironmentVariable('SCOOP',$env:SCOOP,'User')
# 然后下载安装 Scoop (如果使用默认安装路径则直接运行下面的命令)
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
# 或者使用下面的命令安装:
iwr -useb get.scoop.sh | iex

#设置代理
scoop config proxy 127.0.0.1:7890
#取消代理设置
scoop config rm proxy
1
2
3
4
5
6
7
8
9
10
11
12

# bucket

#查看已知库 
scoop bucket known
#列举已添加的库
scoop bucket list
#删除已添加的库
scoop bucket rm <bucket>
#添加已知库
scoop bucket add <bucket>
#添加第三方库
scoop bucket add <bucket> <bucket_url>
1
2
3
4
5
6
7
8
9
10

已添加库:

dorado  
extras  
versions
helbing https://github.com/helbing/scoop-bucket
1
2
3
4

# 安装应用

7zip
marktext
picgo
1
2
3

# 常用命令

# 查看某软件执行命令位置
scoop which {{name}}
# 搜索某软件
scoop search {{name}}
# 打开某软件官网
scoop home {{name}}
# 检查潜在的问题
scoop checkup
# 查看状态
scoop status
1
2
3
4
5
6
7
8
9
10

# winget

  1. 搜索软件

winget search notepad++

  1. 安装软件

使用-l指定安装路径安装app winget install notepad++ -l d:\notepad++

使用-i命令进行交互式安装,即在下载完成后弹出软件的安装页面

  1. 列出已安装应用

winget list

  1. 升级应用

winget upgrade

  1. 卸载应用

winget uninstall

# NVM

安装包下载 (opens new window)

# 查看版本
nvm ls available
# 查看已下载版本
nvm ls
# 下载版本
nvm install [版本号]
# 切换版本
nvm use [版本号]
1
2
3
4
5
6
7
8

# Terminal

# Git Bash

打开 Windows Terminal,点击顶部下拉箭头 ➔ 设置(或按 Ctrl + ,),点击底部的打开JSON文件

添加 Git Bash 配置 ,参数如下:

  • commandline: Git Bash 可执行文件路径(-i -l 表示启动交互式登录 Shell)。

  • name: 终端中显示的名称。

  • icon: Git Bash 图标路径(可选)。

  • startingDirectory: 启动时的默认目录(%USERPROFILE% 为用户文件夹)。

设为默认终端(可选)

settings.json 的根节点添加以下配置,将 Git Bash 设为默认启动项:

"defaultProfile": "{Git Bash 配置的 GUID}"
1

示例配置:

{
  "profiles": {
    "list": [
      {
        "guid": "{00000000-0000-0000-0000-000000000001}",
        "commandline": "\"%PROGRAMFILES%\\Git\\bin\\bash.exe\" -i -l",
        "name": "Git Bash",
        "icon": "%PROGRAMFILES%\\Git\\mingw64\\share\\git\\git-for-windows.ico",
        "startingDirectory": "%USERPROFILE%"
      }
    ]
  },
  "defaultProfile": "{00000000-0000-0000-0000-000000000001}"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14

# 传输文件

  1. 上传本地文件到服务器

scp /path/filename username@servername:/path/

  1. 从服务器上下载文件

scp username@servername:/path/filename /var/www/local_dir

  1. 从服务器下载整个目录

scp -r username@servername:/var/www/remote_dir/ /var/www/local_dir

  1. 上传目录到服务器

scp -r local_dir username@servername:remote_dir

# Office安装与激活

打开powershell输入irm https://massgrave.dev/get | iex

在后续操作页面选择即可

# powershell

# powershell中使用git bash

执行以下命令

& 'D:/installSoft/Git/bin/sh.exe' --login
1
上次更新: 2025/02/26, 15:05:09
最近更新
01
G1垃圾收集器的参数调优
02-23
02
内存占用过大排查
01-14
03
docker-compose笔记
01-12
更多文章>