Skip to main content

MacOS Terminal

Terminal

文件拥有者设置

更换文件为现有用户

sudo chown -R $(whoami):$(id -gn $(whoami)) .

补充: sudo 是一个 option 选项

生成 ssh key

# linux
ssh-keygen -b 2048 -t rsa

# windows
ssh-keygen

了解端口与服务

sysctl -n hw.ncpu # know how much cpu core in macOS

了解端口的运行服务

lsof -i :8081
netstat -an | grep 8081

结束程序

kill <PID>
kill -9 <PID>

连接 websocket

MacOS

websocat ws://localhost:3500

Windows: link

Bash Alias

nano ~/.bash_profile
vim ~/.bash_profile
alias node@v="node --version"
alias node@16="nvm use 16.20.0"
alias node@18="nvm use 18.16.1"
alias node@20="nvm use 20.12.2"