su和su 的區別

2021-09-07 17:30:37 字數 317 閱讀 7408

命令

相同點不同點

su切換到root使用者,具有root使用者的許可權,~代表root使用者家目錄

環境變數變化相當於:source /root/.bashrc

su -

切換到root使用者,具有root使用者的許可權,~代表root使用者家目錄

環境變數變化相當於:source /root/.bash_profile && source /root/.bashrc

說明:su和su -預設是切換到root使用者,但可在其後加上使用者名稱以切換到其他使用者;切換到其他非root使用者su和su -的區別道理一樣。

參考:

su 和su 的區別

剛才用su到root後,用命令gedit發現會出錯 gedit 2976 warning 連線已關閉 gedit 2976 eggsmclient warning failed to connect to the session manager none of the authentication ...

su 和su的區別

joe為普通使用者,root為超級使用者。現象如下 joe trixbox1 su 口令 ifconfig bash ifconfig command not found su命令格式 su p c command username 在切換當前使用者時切換使用者工作環境 p 在切換當前使用者時不切換...

su 和 su 的區別

su命令和su 命令最大的本質區別 su命令和su 命令最大的本質區別就是 前者只是切換了root身份,但shell環境仍然是普通使用者的shell 而後者連使用者和shell環境一起切換成root身份了。只有切換了shell環境才不會出現path環境變數錯誤。su切換成root使用者以後,pwd一...