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带横杠和不带横杠的更多相关文章
- 【linux】su、sudo、sudo su、sudo -i的用法和区别
来源:http://bbs.csdn.net/topics/390938651 sudo : 暂时切换到超级用户模式以执行超级用户权限,提示输入密码时该密码为当前用户的密码,而不是超级账户的密码.不过 ...
- su;su -;sudo;sudo -i;sudo su;sudo su - 之间的区别
今天我们来聊聊su;su -;sudo;sudo -i;sudo su;sudo su -他们之间的区别. su :su 在不加任何参数,默认为切换到root用户,但没有转到root用户家目录下,也就 ...
- su、sudo、sudo su、sudo -i的用法和区别
sudo : 暂时切换到超级用户模式以执行超级用户权限,提示输入密码时该密码为当前用户的密码,而不是超级账户的密码.不过有时间限制,Ubuntu默认为一次时长15分钟.su : 切换到某某用户模式,提 ...
- linux su、sudo、sudo su、sudo -i的用法和区别
sudo : 暂时切换到超级用户模式以执行超级用户权限,提示输入密码时该密码为当前用户的密码,而不是超级账户的密码.不过有时间限制,Ubuntu默认一次时长15分钟. su : 切换到某某用户模式,提 ...
- .htaccess中301强制跳转到带www前缀或不带www的域名
相信很多站长朋友都有这样的的问题出现.即带www前缀的域名与不带www前缀的顶级域名收录情况是不同的.这个问题主要是由于搜索引擎对于顶级域名与二级域名权重判定不同造成的.毫无疑问地,唯一的域名能够给你 ...
- eclipse下将maven项目打包为jar(1.不带第三方jar,2.带第三方jar)
由于项目需要讲maven项目打包为jar包,由于之前没类似经验,百度找例子走了不少弯路,这边随手记录下,网上说的 开发工具:eclipse jar包管理:maven 一般打包出来的jar包分为两种 一 ...
- Java带标签的break 和带标签的continue
最开始没有学习java 学习的是C语言然后工作开始用java,但当时并没有仔细看过java的书籍,也是大致一翻就看跟C语言很像,了解了基本语法就没有深究了,今天看书开始发现之前没有了解过的语法 带标签 ...
- Stamus Networks的产品SELKS(Suricata IDPS、Elasticsearch 、Logstash 、Kibana 和 Scirius )的下载和安装(带桌面版和不带桌面版)(图文详解)
不多说,直接上干货! SELKS是什么? SELKS 是Stamus Networks的产品,它是基于Debian的自启动运行发行,面向网络安全管理.它基于自己的图形规则管理器提供一套完整的.易于使 ...
- 《带你装B,带你飞》pytest修炼之路1- 简介和环境准备
1. pytest简介 pytest是python的一种单元测试框架,与python自带的unittest测试框架类似,但是比unittest框架使用起来更简洁,效率更高.根据pytest的官方网站介 ...
随机推荐
- Laravel框架数据库CURD操作、连贯操作使用方法
Laravel框架数据库CURD操作.连贯如何来操作了这个操作性是非常的方便简单了我们在这里来为各位介绍一篇相关的教程,具体的细节步骤如下文介绍. Laravel是一套简洁.优雅的PHP Web开 ...
- Obiee11g变量
原文地址:http://xee123.blog.163.com/blog/static/277119942012612104438332/ Obiee 版本 11.1.1.5 库变量 库变量在同一时刻 ...
- SDWebImage
SDWebImage 加载图片的流程 入口 setImageWithURL:placeholderImage:options: 会先把 placeholderImage 显示,然后 SDWebImag ...
- springMvc3.0.5搭建全程 (转)
用了大半年的Spring MVC3.0,用着感觉不错.简单写一个搭建Spring MVC3.0的流程(以Spring3.0.5为列),数据库交互使用spring JDBC Template,附件有项目 ...
- spring4.2.3+mybatis+spring-security配置文件
1.web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi=&qu ...
- 转载:Qt之界面实现技巧
总结一下,在开发Qt的过程中的一些技巧!可遇而不可求... 一.主界面 1.窗口 最小化 最大化 关闭按钮.显示状态自定义 setWindowFlags(Qt::CustomizeWindowHint ...
- Chapter 1: Design the application architecture
1.1 Plan the application layers 提到了repository pattern,SoC(Separation of Concern), 进而提及MVC,Action/Act ...
- (zhuan) Deep Reinforcement Learning Papers
Deep Reinforcement Learning Papers A list of recent papers regarding deep reinforcement learning. Th ...
- wine
sudo dpkg --add-architecture i386 sudo add-apt-repository ppa:wine/wine-buildssudo apt-get update su ...
- Yii2安装搭建和将入口文件移到根目录
用Composer下载Yii2速度太慢了,所以我还是喜欢下载打包好的框架文件. 在https://github.com/yiisoft/yii2/releases 下载最新的的Yii2,advance ...