su with hyphen and without - su带横杠和不带横杠

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了su with hyphen and without - su带横杠和不带横杠相关的知识,希望对你有一定的参考价值。

The difference between "-" and "no hyphen" is that the latter keeps your existing environment (variables, etc); the former creates a new environment (with the settings of the actual user, not your own).

带横杠的会创建一个全新的环境,使用的是真实用户的设置。 不带横杠的还保留了之前用户的设置,例如当前目录,环境变量等等。

https://wiki.archlinux.org/index.php/Su

The hyphen has two effects:

1) switches from the current directory to the home directory of the new user (e.g., to /root in the case of the root user) by logging in as that user

2) changes the environmental variables to those of the new user as dictated by their ~/.bashrc. That is, if the first argument to su is a hyphen, the current directory and environment will be changed to what would be expected if the new user had actually logged on to a new session (rather than just taking over an existing session).

 

以上是关于su with hyphen and without - su带横杠和不带横杠的主要内容,如果未能解决你的问题,请参考以下文章

Android项目实战(二十五):Android studio 混淆+打包+验证是否成功

Cisco CMS Ad-Hoc Conferencing with CUCM

HPUX and AIX SSH 互信

Simple and Effective Few-Shot Named Entity Recognition with Structured Nearest Neighbor Learning

css Text Wort Trennung Hyphen自动换行#snippet #css

WITH RECURSIVE and MySQL