Switch user command (su) has the following forms:

su

Switch to , without loading environment variables. If is omitted (only "su"), it equals to "su root";

su -

Switch to , and loading environment variables. "-" is the abbreviation of "-l", which means this is a "login" shell, so all .profile will be sourced (man su for details). If is omitted (only "su -"), it equals to "su - root";

su -c ""

Run command with the identity of another user. It is mostly used in one-off command with root privileges:

su -c "" root

The double quotes around can't be omitted.

Switch User Command in Linux的更多相关文章

  1. screen command of linux

    [screen command of linux] 常用键:   补充: Ctrl-a S  # split terminal horizon Ctrl-a TAB   # switch to ano ...

  2. Sending Email from mailx Command in Linux Using Gmail’s SMTP

    The mailx or mail command in Linux is still providing service for guys like me, especially when we n ...

  3. Cisco IOS Basic CLI Configuration : Switch Port Command

    Cisco IOS Basic CLI Configuration : Switch Port Command 1.  Basic Switch>en Switch#conf t Enter c ...

  4. Using Android Phone to recover SD card formatted with DD command under linux

    Using Android Phone to recover SD card formatted with DD command under linux 1. Formatted a sd card ...

  5. 下载tree命令的源代码 - The Tree Command for Linux Homepage

    The Tree Command for Linux Homepage http://mama.indstate.edu/users/ice/tree/ [root@test ~]# ll -as m ...

  6. Changing the Color of Linux ls Command 改变Linux的ls命令显示的颜色

    Linux command ls basically use the file /etc/DIR_COLORS or /etc/DIR_COLORS.xterm to define the color ...

  7. The dd command of linux

    The dd command stands for "data duplicator" and used for copying and converting data. It i ...

  8. logrotate command in Linux

    背景 在生产过程中,由于磁盘空间.保留周期等因素,会对系统.应用等日志提出要求,要求系统日志定期进行轮转.压缩和删除,从而减少开销,而系统自带的logrotate  则是一个简单又实用的小工具,下面着 ...

  9. To Use FTP Command in Linux

    Yesterday I was asked to upload a file in Linux to the corresponding server. I said "oops" ...

随机推荐

  1. JavaScript基础以及进阶知识

    JavaScript基础知识回顾: 目录: 比较运算符 多行字符串,模板字符串 严格模式 函数定义和调用 变量作用域与解构赋值.NameSpace.块级作用域let.const 方法 高阶函数 闭包 ...

  2. 万字长文肝Git--全流程知识点包您满意【建议收藏】

    您好,我是码农飞哥,感谢您阅读本文,欢迎一键三连哦. 本文将首先介绍在本地搭建GitLab服务,然后重点介绍Git的常用命令,Git的核心概念以及冲突处理,最后介绍Git与SVN的区别 干货满满,建议 ...

  3. 17 shell break与continue

    使用 while.until.for.select 循环时,如果想提前结束循环(在不满足结束条件的情况下结束循环),可以使用 break 或者 continue 关键字. 在C语言.Python.Ja ...

  4. centos7 php开发环境安装-composer

    1.安装composer cd /usr/local/src curl -sS https://getcomposer.org/installer | php mv composer.phar /us ...

  5. XCTF simple js

    思路分析: 进入靶场, 随便输入,肯定是错误的,f12看下源码,结合题目说js,把js代码单独拿出来看看. function dechiffre(pass_enc){ var pass = " ...

  6. 2013年第四届蓝桥杯C/C++程序设计本科B组省赛 第39级台阶

    题目描述: 第39级台阶 小明刚刚看完电影<第39级台阶>,离开电影院的时候,他数了数礼堂前的台阶数,恰好是39级! 站在台阶前,他突然又想着一个问题: 如果我每一步只能迈上1个或2个台阶 ...

  7. linux中如何添加用户并赋予root权限详解

    #adduser username 修改 /etc/sudoers 文件,找到下面一行,在root下面添加一行,如下所示: ## Allow root to run any commands anyw ...

  8. 『心善渊』Selenium3.0基础 — 28、unittest中测试套件的使用

    目录 1.测试套件的作用 2.使用测试套件 (1)入门示例 (2)根据不同的条件加载测试用例(了解) (3)常用方式(推荐) 1.测试套件的作用 在我们实际工作,使用unittest框架会有两个问题: ...

  9. 【重学Java】多线程基础(三种创建方式,线程安全,生产者消费者)

    实现多线程 简单了解多线程[理解] 是指从软件或者硬件上实现多个线程并发执行的技术. 具有多线程能力的计算机因有硬件支持而能够在同一时间执行多个线程,提升性能. 并发和并行[理解] 并行:在同一时刻, ...

  10. 如何处理RabbitMQ 消息堆积和消息丢失问题

    消息堆积 解决方案: 增加消费者或后台相关组件的吞吐能力 增加消费的多线程处理 根据不同的业务实现不同的丢弃任务,选择不同的策略淘汰任务 默认情况下,RabbitMQ消费者为单线程串行消费,设置并行消 ...