2018年8月

安装
brew install bash-completion

查看
brew info bash-completion

添加配置

Add the following line to your ~/.bash_profile:
  [ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion

然后根据提示将配置文件加入 .bash_profile

查看原文

一不小心把文件和目录权限弄错了,想恢复回原有的样子,只需要执行一条命令即可恢复:

find folder '(' -type f -exec chmod 644 {} ';' ')' -o '(' -type d -exec chmod 755 {} ';' ')'

这条命令其实是两条命令合成的:

find folder -type d -exec chmod 755 {} \;
find folder -type f -exec chmod 644 {} \;

-o means OR. This command processes all objects in the project tree that are of type “file” or type “directory”, and executes different commands based on which type each object is.

You can make this slightly more efficient by replacing the semicolons (';') with plus signs (+); this tells find to run chmod 644 once, with all the plain files’ names as arguments, and to run chmod 755 once, with all the directories’ names as arguments.

查看原文