Sunday, December 4, 2016

Linux: Chapter9: User Environment


"很多时候我们不知道,却假装知道;很多事情我们知道,却假装不知道..."
********************  Special Thanks ********************
no-ip --> lms
***************************************************


SECTION 1 Basic Users and Groups
      All Linux users are assigned a unique user ID (uid), which is just an integer, as well as one or more group ID’s (gid), including a default one which is the same as the user ID. Who command to check who are logging in.

    Although leonard is a cassanova, who are in this group can't add the group to sudo group. I mean, this group can't use sudo command. Btw, kevin is a savant so he can sudo visudo to add another group to sudo.



     When you first login to Linux, /etc/profile is read and evaluated, after which the following files are searched (if they exist) in the listed order:
  1. ~/.bash_profile
  2. ~/.bash_login
  3. ~/.profile
       These files are like Oracle DBMS startup files. It checks binary spfile first then plain-text pfile

SECTION 2 Environment Variables





↞ Summary ↠
  • Linux is a multiuser system.
  • To find the currently logged on users, you can use the who command.
  • To find the current user ID, you can use the whoami command.
  • The root account has full access to the system. It is never sensible to grant full root access to a user.
  • You can assign root privileges to regular user accounts on a temporary basis using the sudo command.
  • The shell program (bash) uses multiple startup files to create the user environment. Each file affects the interactive environment in a different way. /etc/profile provides the global settings.
  • Advantages of startup files include that they customize the user's prompt, set the user's terminal type, set the command-line shortcuts and aliases, and set the default text editor, etc.
  • An environment variable is a character string that contains data used by one or more applications. The built-in shell variables can be customized to suit your requirements.
  • The history command recalls a list of previous commands which can be edited and recycled.
  • In Linux, various keyboard shortcuts can be used at the command prompt instead of long actual commands.
  • You can customize commands by creating aliases. Adding an alias to ˜/.bashrc will make it available for other shells.
  • File permissions can be changed by typing chmod permissions filename.
  • File ownership is changed by typing chown owner filename.
  • File group ownership is changed by typing chgrp group filename.


<p><span style="font-family: 'book antiqua', palatino; background-color: #00ccff; color: #ffffff;"><strong>111 040 150 141 166 145 040 154 145 146 164 040 157 165 164 040 155 141 156 171 040 164 150 151 156 147 163 040 163 151 156 143 145 040 111 040 150 141 166 145 040 153 156 157 167 156 056 040 115 157 162 145 040 144 145 164 141 151 154 163 040 160 154 145 141 163 145 040 143 150 145 143 153 040 141 164 040 122 145 146 145 162 145 156 143 145 056</strong></span></p>

Reference:
https://www.linuxfoundation.org
JAYz - { KevinChen 陳爱平}

No comments:

Post a Comment