跳至主要內容

window 使用技巧

OrangBus大约 2 分钟

Windows Terminal默认打开路径

{
    "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
    "name": "Windows PowerShell",
    "commandline": "powershell.exe",
    "hidden": false,
    "startingDirectory" : "d:/laragon/www/"
},

Windows Terminal中WSL默认打开路径(startingDirectory)

"startingDirectory": "//wsl$/Ubuntu-20.04/home/baiguo",

Cmd 打开当前文件夹

start .

explorer .

Ps: 仔细看后面是有一个点的

Window10-11官方下载

window10:https://www.microsoft.com/zh-cn/software-download/windows10ISOopen in new window

window11: https://www.microsoft.com/zh-cn/software-download/windows11open in new window

如果你有更好的资源,请联系我! 其实我收藏了太多了,懒得整理了,以后关注的人多了在说吧!

window git别名

# cd
# vim .bashrc

alias cls='clear && ls'
alias la='ls -a'

alias web="cd /d/laragon/www"

重载配置

source .bashrc

微信多开

# 创建一个 wechat.bat 文件,按照这个格式编辑保存,双击运行即可

start "" "D:\Program Files (x86)\Tencent\WeChat\WeChat.exe"
start "" "D:\Program Files (x86)\Tencent\WeChat\WeChat.exe"

清理C盘的3种办法

1、使用电脑管家快速清理

2、转移C盘安装软件到其他盘

3、修改C盘 appData 位置

计算机\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
# 以及
计算机\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
image-20221208091757212
image-20221208091757212

修改后

image-20221208092148738
image-20221208092148738

接着把 C:\Users\$USER$\AppData 复制到你自定义为位置,重启电脑即可

对于c盘的文件,你可以查看你改动过的目录,把对应的目录文件删除即可,其他没有改动的文件就保持原来的。

window下如何给git bash添加别名

方法一

vim /etc/profile

在该文件的最后面添加我们的别名

alias web='cd /d/laragon/www'
alias cls='clear && ls'

# git
alias ga="git add ."
alias gm='git commit -m'
alias gp="git push $1"

# laravel 快捷别名
alias pa='php artisan '
alias pac='pa make:controller '
alias pae='pa make:event '
alias pahm='pa ide-helper:models'
alias pam='pa make:model '
alias pamm='pa migrate'
alias paqc='pa queue:clear'
alias paqw='pa queue:work'
alias pas='pa serve'
alias pat='pa tinker'
alias pats='pa telescope:clear'
alias pacms="pa make:command "
alias php81="/www/server/php/81/bin/php"

alias llw="ls -l | grep "^-" | wc -l"

使其生效即可

source /etc/profile

方法二

cd // 回到home目录
vim .bashrc

=== 添加你自己的别名==
alias web='cd /d/laragon/www'
alias cls='clear && ls'

# git
alias ga="git add ."
alias gm='git commit -m'
alias gp="git push $1"

使其生效

source /etc/profile

清理npm缓存

npm cache clean --force
npm config set registry https://registry.npm.taobao.org
# npm install -g node-pre-gyp
composer clear-cache
pip cache purge

不走代理的配置

*.test;
192.168.*;
127.0.0.1;
locahost;
home.com;
*.home.com

nvm配置镜像源

https://developer.aliyun.com/article/971101

安装的目录下打开settings.txt文件

node_mirror: https://npm.taobao.org/mirrors/node/ 
npm_mirror: https://npm.taobao.org/mirrors/npm/

设置npm为淘宝源

npm config set registry https://registry.npm.taobao.org
npm config set disturl https://npm.taobao.org/dist

查看

npm config get registry

代理排除

*.test
home.com
ui.com
192.168.2.44
api.wugou.com
admin.wugou.com
platform.wugou.com
doc.home.com
movie.com
admin.movie.com
*.movie.com
gaobuba.com
gaozhidazhuan.com
*.orangbus.cn

共享文件配置

开启smb

image-20240122100140489
image-20240122100140489

开启网络共享

image-20240122100912917
image-20240122100912917

打开管理

image-20240122094918581
image-20240122094918581

找到用户,在空白区域右【新建用户】

image-20240122095125468
image-20240122095125468

授权访问

image-20240122095235017
image-20240122095235017

选择刚刚添加的用户

image-20240122095316681
image-20240122095316681

点击共享以后即可通过ip直接访问。(window ip获取:ipconfig)

image-20240122095929670
image-20240122095929670