美文网首页
常用命令

常用命令

作者: bestCindy | 来源:发表于2022-07-20 18:05 被阅读0次

Tree

# 安装
brew install tree
# 使用
tree -d        // 只显示文件夹
tree -L n        // 显示项目的层级 n表示层级数
tree -I pattern        // 用于过滤不想要显示的文件或者文件夹
tree > tree.md        // 将项目结构输出到 tree.md 这个文件
# 

清除 dns 缓存

# OS X Mountain Lion or Lion
sudo dscacheutil -flushcache
# Mac OS X v10.6
sudo killall -HUP mDNSResponder

nginx

# 安装
brew install nginx
# 重启
nginx -s reload

初始化 git

# 生成 ssh
ssh-keygen -t rsa -C ""
# 别名
ssh-keygen -t rsa -f ~/.ssh/zhongan -C ""
# 设置姓名/邮箱
git config --global user.name "zhanghao"
git config --global user.email ""
# 关闭 SSL 验证
git config --global http.sslVerify false

安装 oh-my-zsh

# <https://www.jianshu.com/p/ba08713c2b19>
sh -c "$(curl -fsSL <https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh>)"

autojump

# 安装
brew install autojump

# zshrc 配置
# 编辑 vi ~/.zshrc
plugins=(git autojump)
[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh

# 刷新配置
source ~/.zshrc

# 目录权限问题
chmod 755 /opt/homebrew/share/zsh

# 删除 Last Login
touch ~/.hushlogin

安装 brew

# <https://zhuanlan.zhihu.com/p/59805070>
# <https://zhuanlan.zhihu.com/p/112383265?from_voters_page=true>
git clone git://mirrors.ustc.edu.cn/homebrew-core.git//usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1

# 使用国内镜像
/bin/zsh -c "$(curl -fsSL <https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh>)"

# 解除锁定
rm -rf /usr/local/var/homebrew/locks
# 或者这样
sudo chown -R "$USER":admin /usr/local
brew cleanup

环境变量

# 编辑
vi ~/.bash_profile
# 刷新
source ~/.bash_profile

curl https

# <https://blog.csdn.net/lixuande19871015/article/details/88788699>
# 下载证书
<https://curl.haxx.se/ca/cacert.pem>
# 设置环境变量
vi ~/.bash_profile
export CURL_CA_BUNDLE=/etc/curlssl/cacert.pem
source ~/.bash_profile

VSCode

# 设置字体
<https://blog.csdn.net/chenghai37/article/details/81417293>

设置文件权限

# 找到模块地址
npm root -g
# 设置权限 
sudo chown -R $applename ../node_modules

Github 访问慢

# <https://github.com.ipaddress.com/>
# 刷新 cdn
dscacheutil -flushcache

GitLab 同步 fork 分支

# 添加项目远程仓库到 upstream 
git remote add upstream <仓库地址> 
# 删除本地 upstream
git remote rm upstream
# 查看配置信息
git config --list
# 更新到本地的 upstream 
git fetch upstream 
# merge
git merge upstream/master

Git 多账号登录

<https://www.barretlee.com/blog/2016/03/09/config-in-ssh-after-troubling-git-connection/>
# ~/.ssh/config
# personal server  
Host personal
  HostName proxy1.barretlee.com proxy2.barretlee.com
  User barretlee
  IdentityFile ~/.ssh/proxy.barretlee.com.key

# school
HostName 222.20.74.89
  User school
  LocalForward 8999 127.0.0.1:3306
  IdentityFile ~/.ssh/school.key
# and so on.

husky 配置

npm install husky lint-staged commitlint -D && npx husky init
//.husky/pre-commit
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
npx --no-install commitlint --edit $1
# 增加权限
chmod ug+x .husky/*
chmod ug+x .git/hooks/*

相关文章

  • 其他

    Git常用命令mac常用命令Linux 常用命令汇总Linux 常用命令0Linux 常用命令1--ls命令

  • Docker

    目录 常用命令 常用命令

  • Linux CentOS基础知识和常用命令

    常用命令1 常用命令2 常用命令3 常用命令4 Linux 目录配置 1、根目录(/)根目录(/)所在分区应该越小...

  • Shell命令汇总

    1、一般常用命令 (1)Shell 常用命令总结 (2)Shell的18条常用命令整理 2、文件操作常用命令 (1...

  • Flutter - 常用命令

    Flutter 常用命令 Flutter 常用命令: Flutter 常用命令说明flutter列出所有的命令fl...

  • Linux常用命令

    Linux常用命令 查看系统信息常用命令 常用命令-关机或重启命令 命令前结构

  • Linux 常用命令汇总

    Linux 常用命令0Linux 常用命令1--ls命令 参考 Linux 常用命令汇总

  • 设置更改root密码、连接MySQL、MySQL常用命令

    设置更改root密码 连接MySQL 连接MySQL MySQL常用命令 MySQL常用命令MySQL常用命令 扩...

  • 1.Vagrant搭建统一开发环境 常用命令

    前言:从Vagrant常用命令开始... ⚠️Vagrant 版本 2.2.01.Box常用命令2.VM常用命令 ...

  • SQL常用命令书目录

    SQL常用命令之单表查询 SQL常用命令之多表查询 SQL常用命令之模糊查找 SQL常用命令之空值查询 SQL常用...

网友评论

      本文标题:常用命令

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