1. hosts 文件位置:
    /etc/hosts

  2. 使用homebrew:

    1. 安装homebrew:
      # /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
      /usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"
      git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git
      git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
      git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
    2. 安装软件:
      brew install 软件
    3. 卸载软件:
      brew uninstall 软件
    4. 列出已安装软件:
      brew list
  3. 显示隐藏的文件夹和文件:

    1. 显示:
      defaults write com.apple.finder AppleShowAllFiles -bool true
    2. 隐藏:
      defaults write com.apple.finder AppleShowAllFiles -bool false
  4. 添加别名:

    vim ~/.bash_profile
    或
    vim ~/.zshrc

    alias ll='ls -lah'

  5. 复制为路径:
    Command+Option+C

  6. 取消开盖自动开机:
    sudo nvram AutoBoot=%00

  7. 恢复开盖自动开机:
    sudo nvram AutoBoot=%03

  8. 截屏:
    Control + Command + Shift + 4

  9. 录屏:
    Command + Shift + 5

  10. 快速锁屏:
    Control + Command + Q

  11. 开启/关闭全屏:
    Control + Command + F

  12. 发送表情:
    Control + Command + Space

  13. 查看指定端口的进程号:
    lsof -i:80

文档更新时间: 2024-04-20 10:57   作者:lee