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.

相關內容