- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
简单的问题,有什么区别
su oracle
和 su - oracle
我不确定 -
在这两个命令中的意义是什么。
更新:
执行 su oracle 后,尝试了 which sqlplus 但无法识别,但通过执行 su - oracle
,设置了 sqlplus 环境。
最佳答案
根据手册页
-l Simulate a full login. The environment is discarded except for HOME, SHELL, PATH, TERM, and USER. HOME and SHELL are modified as above.
USER is set to the target login. PATH is set to ``/bin:/usr/bin''. TERM is imported from your current environment. The invoked shell is
the target login's, and su will change directory to the target login's home directory.
- (no letter) The same as -l.
简而言之,如果您使用su - oracle
,您会切换到用户oracle
,并且环境会被重置。没有-
,环境不会重置。
例如,没有 -
:
#(root) export HELLO=world
#(root) su postgres
$(postgres) echo $HELLO
world
$(postgres)
还有 -
:
#(root) export HELLO=world
#(root) su - postgres
$(postgres) echo $HELLO
$(postgres)
关于unix - su oracle 和 su - oracle 之间的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14842749/
简单的问题,有什么区别 su oracle 和 su - oracle 我不确定 - 在这两个命令中的意义是什么。 更新: 执行 su oracle 后,尝试了 which sqlplus 但无法识别
我正在尝试找出一些给我的代码。有人能告诉我这是什么意思吗? process = Runtime.getRuntime().exec("su"); os = new DataOutputStream(p
我正在尝试将自己设置为 root,一旦我在终端中输入 su - root 它就会给我一个错误提示/bin/su: Permission denied 所以我检查了权限在那个文件中 -rwsr-x---
当我尝试从具有系统权限的程序运行 su 命令时,我在 stderr 上返回了这个错误: uid 1000 not allowed to su 我将共享 uid 设置为 android.uid.syst
我想用非 root 用户启动一个容器,但我不能修改原始 Dockerfile,或者我知道我可以做一些像 Run useradd xx 然后 User xx 在 Dockerfile 中实现。我现在正在
我正在尝试编写一个将运行以下命令的脚本: sudo su runmqsc_result=`su -c "runmqsc QMGR 或者,您可以使脚本只能由 root 编写,并将以下内容添加到 /et
当我使用 adb 访问我的设备时(Android 4.4.2 直接来自制造商及其定制的 rom - 它不是常规设备 - 它内置了二维条码扫描仪)它直接进入了一个 # 我已经read 意味着我有 roo
我正在编写一个 bash 脚本来扫描多台 linux 机器以查看它是否符合组织的标准: grep "sulogin" /etc/inittab ~:S:wait:/sbin/sulogin 我正在使用
我有一个 bash 脚本,需要在不同的用户下运行几个命令。我想使用 su 执行此操作,但如果没有密码提示,我无法自动 su。 运行脚本的用户将是 centos 中的 apache(因此不是真实的用户帐
我想用 su 在一个命令行中更改用户 echo password | su user 但这行不通。还有其他的可能性吗?最良好的祝愿 最佳答案 首先:问问自己脚本是否真的有必要知道密码。 sudo 和
passwd命令 passwd 命令用来修改您的密码。 语法: 语法是 passwd [命令开关] 命令开关: -a 显示密码属性的所有项目。
我有一个 linux 用户 (user2),它已设置为 shell /usr/sbin/nologin(以阻止登录)。不,当我尝试使用 sudo su user2 切换到该用户时,我得到的信息是该帐户
今天早上我犯了一个小错误。 我想更改 wordpress 网站目录的所有者,我命令如下。 sudo chown -vR :theuser / var/wwwwordpress/ 但是这个命令是错误的。
如果我运行这个命令: su -l otheruser -c 'strace /usr/lib/systemd/systemd --user 2> /tmp/su.err' 失败了: Failed to
所以我无法让 su 命令在终端上工作。我所做的就是输入“su”并按 Enter 键,它会要求输入密码,然后我输入当前登录的用户密码。它总是给出这个错误。我发誓这以前有用,不知道发生了什么。 su: S
我正在使用流分析来实现简单的数据传递场景。 作业具有多个 SQL Server 输出(三个)和一个 EventHub 输入。事件数量很少。问题是我的 SU 利用率不断增加。我的临时解决方案是每天重新启
我是一名关于 Vagrant 的新生。我刚刚发现,当我在 Vagrant 监督的盒子里时,我可以通过“sudo su -”更改为 root,而无需输入密码。 奇怪的是,我检查了“/etc/sudoer
我有一个程序,该程序将使用密码作为输入,然后执行 shell 程序以在UNIX中执行“su”(切换用户)命令。但是,我不知道如何将password变量传递给UNIX su命令。我必须为此使用的语言非常
Process process = Runtime.getRuntime().exec("su"); 在 上运行上述命令时 Root 电话一切正常 但是当我在 上尝试相同的代码时无根设备导致内存泄漏,
我使用 boost 1_65_1 并尝试在 MacOS 上运行一个进程。我的主要进程以 root 身份运行我需要以普通用户身份启动子启动。我的命令行:su user_name -c "full 可执行
我是一名优秀的程序员,十分优秀!