Updated at 2021-04-30 15:56

命令行

  1. 阿里云Homebrew镜像

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    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
    # 替换homebrew-bottles:
    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
    source ~/.zshrc
  2. 安装Oh my zsh

    zsh --version
    chsh -s /bin/zsh
    sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
  3. 对当前目录下的每个目录,执行git pull,不递归

    for i in */.git; do ( echo $i; cd $i/..; git pull; ); done
  4. 查看IP

    # 内网
    ifconfig | grep "inet " | grep -v 127.0.0.1
  5. 查看端口占用

    lsof -i tcp:80
  6. 查询日志

    # 根据关键字
    cat INFO.log | grep -n 'keyword'
    # 根据行
    cat INFO.log | tail -n +23333 | head -n 10
    # 最近的日志,可滚动
    tail -f -n -500 INFO.log

环境

  1. JBR8

    https://bintray.com/jetbrains/intellij-jbr/jbrsdk8-osx-x64#files


Memorandum      Mac OS