SU Command--linux command application large dictionary 729 interpretation of commands

Source: Internet
Author: User

The content originates from the people's post and Telecommunications press "Linux command Application big dictionary"

tell 729 commands, 1935 examples

Learn about the Linux system's reference books, desk book, encountered the command or command not understand the options can be found

Strive to publish content every day


SU command

You can use the su command to switch to another user account to log in. If the SU command does not have any options, the default is to switch to the root user without changing the Shell environment.

Command syntax:

su [ options ] [ user ]

The meanings of the options in the command are as follows is shown.

table su command options meaning

Options

Meaning

-

Change Login Shell

-L

log in and change users Shell Environment

-F

suitable for csh and Tsch, so that the Shell does not have to read the boot file

-M

Do not set environment variables

-S <shell type >

specifies what to do. Shell Type

-C < commands >

Executes a command, and then exits the user environment in which it is located

Example : Switch User root to user it for login and even Shell environment.

[Email protected] ~]# su-it

Switch from user root to normal user it does not need to enter the user's password

[Email protected] ~]$ pwd

/home/it

the Shell environment has switched, so the current working directory path is /home/it

Example : Switch User root to user it to log in, theShell environment does not need to switch.

[email protected] ~]# SU it

[Email protected] root]$ pwd

/root

the Shell environment does not switch, so the current working directory path is /root

Example : Switch from user it to user root login system, and even Shell environment switch.

[email protected] ~]$ Su-

Password: // Enter the user root password here

[Email protected] ~]#

// switch from normal user to Root users need to enter Root User's password

Example : User It uses the Su method to execute the "ls/root" command with the root user .

[Email protected] ~]$ su-root-c "Ls/root"

Password: // Enter the user root password here

Anaconda-ks.cfg install.log install.log.syslog public template video picture Document


This article from "airfish2000" blog, declined reprint!

SU Command--linux command application large dictionary 729 interpretation of commands

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.