/etc/apache/bin 加入 PATHPATH=$PATH:/etc/apache/bin
export PATH
✅ 立即生效 ❌ 登出失效
/etc/profile(全域永久)vi /etc/profile
# 尾端加入
export PATH=$PATH:/etc/apache/bin
✅ 所有用戶、重開機永久生效 ⚠ 需 source /etc/profile 或重新登入
~/.bash_profile(用戶級永久)vi ~/.bash_profile
# 找到 PATH 行附加
export PATH=$PATH:/etc/apache/bin
✅ 僅當前用戶、永久生效
source /etc/profile # 當前 Shell 執行,環境變數保留
. /etc/profile # 同 source
sh /etc/profile # 子 Shell 執行,變更不回傳
echo $PATH
/etc/profile。~/.bash_profile 或 ~/.bashrc。export 並在同一 Shell 執行。