Ubantu problem record

2019.4.21
Ubantu question:
Common command:
sudo is a rights management mechanism, depending on the / etc / sudoers, licensed to define which users
can manage as an administrator to perform the command
format: sudo -u USERNAME COMMAND
default, The system only the root user can execute sudo command. Requires root user by using the
visudo command to edit the sudo configuration file / etc / sudoers, you can authorize other ordinary users to run
sudo command

su shorthand seitch user, the user switches

Format:
su the -l USERNAME (the -l is shorthand login, login)
If you do not specify a USERNAME (user name), the default is root, so the switch to the root of the identity of the order shall be:
su -root or su -, su root, or su

su USERNAME, and su - USERNAME the following differences:

su - USERNAME after the handover user, and switch to the new user's work environment.

su USERNAME after switching user, do not change the original user's working directory, and other environment variable.

su -, when su -l command or su --login change of identity, and also to change the working directory, and the HOME,
SHELL, the USER, LOGNAME. In addition, the PATH variable will change. With the su - command to convert the default root user.

Rather than "su command" with the parameter does not change the current working directory and HOME, SHELL, USER, LOGNAME. Just have root privileges only.

apt command:
# install software
$ sudo apt install software name
# uninstall software
$ sudo apt remove the software name
# updated list of available packages
$ sudo apt update
package # update has been installed
$ sudo apt upgrade

Guess you like

Origin www.cnblogs.com/kaka6k66k/p/11718091.html