更新时间:2022-10-14 23:30:59
cd到目录Y的根目录 b
$ b
then假设文件夹名称为X,输入):
find。-name X -exec rm -rf {} \;
(并且非常小心,您从哪里开始这个 find
,您只需要在Y目录中执行此操作。
我一直在做这种事情来删除旧的/破坏的存储库目录(如 .svn
),我怀疑是你也可以做的。
现在可能是一个聪明的时候,我提醒你,时间机器是一个在Macintosh上启用的好东西。
There is a folder named X located within a number of subfolders of root directory Y. I want to delete all folders named X that are present in Y and all of it's subfolders. I want to do this using osx Terminal.
The folder can be located anywhere downstream of Y at any level, so I want to use a more systematic approach than just using rm -r
for every locations I find.
"cd" to root of directory Y
then (assuming the folder name is "X", type in):
"find . -name X -exec rm -rf {} \;
" (and be incredibly careful about where you start this "find
" from... you only want to do this within your Y directory).
I do this kind of thing all the time to remove old/busted repository directories (like ".svn
"), which I suspect is what you may also be doing as well.
And now would probably be a smart time for me to remind you that "Time Machine" is a great thing to have enabled on your Macintosh.