Kanglin Wukanglin.hashnode.dev·Jan 15, 2025Linux command su - meaningsu(switch user)用來切換使用者的命令。預設情況下不會載入目標使用者的環境變數。 而 - 是 su command 的 option,用於告訴系統模擬完整的登入行為,包括載入目標使用者的登入 shell、初始化的環境變數(例如 $PATH)、以及執行目標使用者的 shell 啟動腳本(如 .bashrc 或 .bash_profile)。 Example Create new user account - lucy kanglin@lab1:~$ sudo adduser lucy ...su