惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Cyber Attacks, Cyber Crime and Cyber Security
The Last Watchdog
The Last Watchdog
Forbes - Security
Forbes - Security
S
Security @ Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hacker News: Front Page
W
WeLiveSecurity
WordPress大学
WordPress大学
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
N
News | PayPal Newsroom
D
DataBreaches.Net
博客园_首页
Y
Y Combinator Blog
F
Fortinet All Blogs
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Hugging Face - Blog
Hugging Face - Blog
The GitHub Blog
The GitHub Blog
B
Blog RSS Feed
C
CERT Recently Published Vulnerability Notes
P
Privacy & Cybersecurity Law Blog
Help Net Security
Help Net Security
S
SegmentFault 最新的问题
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
N
News and Events Feed by Topic
Schneier on Security
Schneier on Security
V
Vulnerabilities – Threatpost
A
About on SuperTechFans
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
L
LangChain Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
L
LINUX DO - 热门话题
Simon Willison's Weblog
Simon Willison's Weblog
雷峰网
雷峰网
G
Google Developers Blog
Cyberwarzone
Cyberwarzone
I
Intezer
Google DeepMind News
Google DeepMind News
AWS News Blog
AWS News Blog
C
Check Point Blog
AI
AI
博客园 - 【当耐特】
有赞技术团队
有赞技术团队
博客园 - 司徒正美

博客园 - Michael Zhang

MacBook Home End SLES Install cucumber soapui test web services S/4 HANA Solution Manager Linux下创建新用户 2008 R2中的无线连接 wireless 不实用,还小有点意思-IE6 UI测试中的小发现 [转载]一个回收站小工具---RecycleBin Gotcha 尝试改变Survey完成后的默认行为(JavaScript) SharePoint开发中的小点滴 Document Library的URL 添加新的站点栏目类型(New Custom Field (Column) Type) 完全控制SharePoint站点菜单(Get full control of SharePoint ActionMenus) Part 1 从WSS 3.0到MOSS 2007 WSS文档库备份及复制 如何备份sharepoint中的文档库? Document Library中Server Menu问题(New和Upload菜单消失) 站点迁移 从单机到服务器场 从上海到大连 又出现两个问题 关于Alert和WebDAV Sharepoint 2007 Forms认证与File Not Found错误
su with hyphen and without - su带横杠和不带横杠
Michael Zhang · 2016-10-12 · via 博客园 - Michael Zhang

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).