匹配文件(shell 和 js)
https://github.com/isaacs/node-glob
https://github.com/isaacs/minimatch
像 shell 一样匹配文件
shell 本身支持匹配文件,node-glob 包使我们可以在 js 中像 shell 一样去匹配文件
语法
1 | <!-- 列出匹配的文件 --> |
* 匹配任意长度任意字符? 匹配任意单个字符[list] 匹配指定范围内(list)任意单个字符,也可以是单个字符组成的集合[^list] 匹配指定范围外的任意单个字符或字符集合[!list] 同[^list]{str1,str2,...} 匹配 str1 或者 str2 或者更多字符串,也可以是集合
生成目录树
win 下$ tree /f > tree.md
mac 下 bashtree > tree.md
vim
i 进入编辑模式
esc 后输入 :wq 保存退出
mac 用户权限问题
遇到 Permission Denied 不要再 sudo 了,关闭 SIP 即可