Linux命令-su-用户

[yangfenghe@localhost bin]$ su -?
su: invalid option – ‘?’
Usage:
su [options] [-] [USER [arg]…]
用法:
su [选项] - [ 用户 [参数]]

Change the effective user id and group id to that of USER.
A mere - implies -l. If USER not given, assume root.
将有效用户的ID和用户组的ID更改为你输入USER的ID
如果用户USER没有给出,默认为root

Options:
-m, -p, --preserve-environment do not reset environment variables
保存环境,不会重置环境变量

-g, --group specify the primary group
指定最主要的组
在这里插入图片描述
-G, --supp-group specify a supplemental group
指定一个辅助组

-, -l, --login make the shell a login shell
使shell成为登录shell

[root@localhost bin]# su -l
Last login: Fri Aug 16 16:55:18 CST 2019 on pts/0
[root@localhost ~]# su --login
Last login: Fri Aug 16 16:56:57 CST 2019 on pts/0
[root@localhost ~]# su -
Last login: Fri Aug 16 16:57:18 CST 2019 on pts/0

-c, --command pass a single command to the shell with -c
–session-command pass a single command to the shell with -c
and do not create a new session
-f, --fast pass -f to the shell (for csh or tcsh)
向shell传递一条 -f选项在这里插入图片描述

-s, --shell run shell if /etc/shells allows it
若/etc/shells允许,运行shell
在这里插入图片描述
-h, --help display this help and exit显示此帮助并退出
-V, --version output version information and exit输出版本信息并退出

For more details see su(1).

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值