Mac操作命令汇总

文件上传到服务器

// ip_address: 服务器ip地址
scp -P 22 /filename root@ip_address:/file_path/

从服务器下载文件到本地

// root: 用户名
// ip_address: 服务器ip地址
// file_name: 服务器上的文件名
// file_path: 服务器上文件的路径
// filepath_local: 本地的路径
// filename_local: 本地的文件名
scp root@ip_address:file_path/file_name filepath_local/filename_local

压缩zip格式

// filename.zip: 压缩后的文件名
// filepath/ : 要压缩的路径
 zip -q -r filename.zip filepath/

ssh登陆服务器

// root: 登陆用户名称
// ip_address: 服务器ip地址
ssh -q -l root -p 22 ip_address

提示安装包损坏

sudo spctl --master-disable
sudo spctl --master-enable

制作苹果系统盘

// Mojave : 10.14
// U盘名称: MacOS
sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/MacOS 

更换Homebrew源

# 阿里云

# 替换brew.git
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
# 替换homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
# 刷新源
brew update

# 清华源

# 替换brew.git
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
# 替换homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
# 刷新源
brew update

参考博客 https://blog.csdn.net/weixin_43902730/article/details/88261760

Mac安装mysqlclient

brew install mysql-client
echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile
export PATH="/usr/local/opt/mysql-client/bin:$PATH"
pip3 install mysqlclient

https://github.com/PyMySQL/mysqlclient-python

持续更新...

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×