
Linux除了/bin和/sbin/之外,還有哪些目錄存放可執行檔?我知道 whereis 命令用於查找檔案的位置,但除了這兩個目錄之外我找不到任何其他目錄。
答案1
請注意,可執行檔也可以位於 /opt//bin 和 /opt/ 中/sbin。此外,/usr/libexec 中也常存在。
答案2
一些可執行檔儲存在/usr/bin
( 和/usr/sbin
) 中。這通常是安裝的腳本和應用程式。/usr/local/bin
如果您想從整個系統(或)執行您自己的腳本,您應該將它們儲存在其中/usr/local/sbin
。看https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard