1. brew使用

brew 又叫Homebrew,是Mac OSX上的软件包管理工具,能在Mac中方便的安装软件或者卸载软件, 只需要一个命令, 非常方便。

brew install tree

  1. #显示所有文件和目录
  2. $ tree -a
  3. #在文件和目录清单加上色彩,便于区分各种类型
  4. $ tree -C
  5. #显示目录名称而非内容
  6. $ tree -d
  7. #列出文件或目录的更改时间
  8. $ tree -D
  9. #在每个文件或目录之前,显示完整的相对路径名称
  10. $ tree -f

2. 终端ll解决方案

  1. $ echo "alias ll='ls -alF'">>.bash_profile
  2. $ source ~/.bash_profile
  3. // 解决每次使用mac都要进行配置的问题
  4. $ echo "soucre .bash_profile">>.bash_profile

3. 终端code解决方案

参考:https://code.visualstudio.com/docs/setup/mac

  1. #进入bin目录
  2. $ cd /usr/local/bin
  3. #从vscode中的path中删除代码
  4. $ sudo rm -rf code
  5. #启动vscode
  6. command + shift + p --> install code

4. 给Terminal终端添加命令提示插件

1、打开一个终端新界面

  1. git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
  1. 打开~/.zshrc文件,添加
    1. source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
    3、终端执行
    1. source ~/.zshrc

    4. mac常用命令汇总

    ```javascript

    日历

    $ cal [month] [year]

日期

$ date

  1. ```javascript
  2. #给某个命令定义别名
  3. $ alias xxx='example'
  4. 例如open命令
  5. $ cd ~/.bash_profile
  6. $ echo "alias op='open'">>.bash_profile
  7. 或者vim进行编辑