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

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

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.

答案1

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

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

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

要删除目录,可以使用rm -rf而不是rm

相关内容