Last active
March 7, 2023 11:30
Revisions
-
navono revised this gist
Mar 7, 2023 . 1 changed file with 1 addition and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,9 +8,4 @@ find . -name "node_modules" -type d -exec rm -rf '{}' + # rm -rf '{}' 删除匹配到到('{}') # + 是个骚操作 # 一个-exec只能执行一个命令,而且必须在命令后面加上终结符,终结符有两个:“;”和“+”。 # 其中";" 会对每一个find到的文件去执行一次cmd命令。而”+“让find到的文件一次性执行完cmd命令。 -
navono created this gist
Mar 7, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ # 递归删除下工程内的所有node_modules find . -name "node_modules" -type d -exec rm -rf '{}' + # 命令拆解注释 # . 当前目录 # -name 名字匹配,指定字符串作为寻找文件或目录的范本样式; # -type 查询文件类型。 -d 就是目录 # -exec 就是匹配后执行一些命令 # rm -rf '{}' 删除匹配到到('{}') # + 是个骚操作 # 一个-exec只能执行一个命令,而且必须在命令后面加上终结符,终结符有两个:“;”和“+”。 # 其中";" 会对每一个find到的文件去执行一次cmd命令。而”+“让find到的文件一次性执行完cmd命令。 作者:CRPER 链接:https://juejin.cn/post/6987327299167191054 来源:稀土掘金 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。