Unix命令删除不同文件夹中的文件


0

Homebrew给了我一些警告,并告诉我从/ usr和/ Library文件夹中删除某些文件,这些文件妨碍了某些安装。有没有办法从根目录中删除这些文件,还是我必须手动

Warning: libiconv files detected at a system prefix other than /usr
Homebrew doesn't provide a libiconv formula, and expects to link against
the system version in /usr. libiconv in other prefixes can cause
compile or link failure, especially if compiled with improper
architectures. OS X itself never installs anything to /usr/local so
it was either installed by a user or some other third party software.

tl;dr: delete these files:
    /usr/local/lib/libiconv.dylib
    /usr/local/include/iconv.h

它还告诉我删除另一个文件

Warning: /Library/Frameworks/Mono.framework detected
This can be picked up by CMake's build system and likely cause the build to
fail. You may need to move this file out of the way to compile CMake.

Answers:


0

您可以将文件的绝对路径传递给rm,如下所示:

rm /usr/local/lib/libiconv.dylib
rm /usr/local/include/iconv.h

无论您位于哪个目录中,它们都将起作用。

要删除目录,请使用rm -rf代替rm


谢谢,但是问题/Library/Frameworks/Mono.framework的最后一部分中的目录呢?Rm不会删除目录
BrainLikeADullPencil

那是目录吗?您的问题暗示这是一个文件。
cpast

您的解决方案适用于这两个文件,但是在尝试回答后,我发现问题的最后一部分指向目录。无论如何,我现在做了rm -rf /Library/Frameworks/Mono.framework
BrainLikeADullPencil 2013年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.