I. Ubuntu SYSTEM Environment variables
Ubuntu Linux System environment variable configuration file is divided into two types: system-level files and user-level files
1. System-Level files:
/etc/profile: The first file that is used when the operating system customizes the user environment when logging on, this file sets the environment information for each user of the system, and when the user first logs on, the file is executed and from/etc/ The configuration file of the PROFILE.D directory collects the shell settings, which is generally called the/ETC/BASH.BASHRC file
/ETC/BASH.BASHRC: A system-level BASHRC file that executes this file for each user running the bash shell, and the file is read when the bash shell is opened.
/etc/environment: The second file used by the operating system at logon, the system sets environment variables for environment files before reading your own profile
2. User-level files:
~/.profile: Each user can use this file to enter shell information dedicated to their own use, when the user logs on, the file is only executed once! By default, he sets some environment variables to execute the user's. bashrc file.
~/.BASHRC: This file contains bash information specifically for your bash shell, when you log in and every time you open a new shell. The file will be read
~/.bash_profile: Each user can use this file to enter shell information dedicated to their own use, when the user logs on, the file is only executed once! By default, he sets some environment variables to execute the user's. bashrc file. ~/. Bash_profile is interactive, login way into bash run ~/.BASHRC is the interactive non-login way into bash usually the two settings are roughly the same, so the former usually calls the latter.
~./bash_login: This is not recommended and does not affect the graphical interface. and. Bash_profile priority is higher than bash_login. When they are present, the login shell reads them when they are started.
~/.bash_logout: Executes the file each time it exits the system (exiting the bash shell).
~/.pam_environment: User-level environment variable settings file.
3. Execution order
For the entire system:
/etc/enviroment-->/etc/profile-$HOME/.profile-$HOME/.env (if present)
/etc/profile is the environment variable for all users
/etc/enviroment is the environment variable of the system
The order in which the shell reads the system when logging in should be
/etc/profile->/etc/enviroment-$HOME/.profile--> $HOME/.env
The reason should be the difference between the user environment and the system environment.
If the same variable has different values in the user environment (/etc/profile) and the system environment (/etc/environment), then the user environment should prevail.
The procedure to execute a file when logging on to Linux is as follows:
When you first log in to Linux, start the/etc/profile file, and then start one of the ~/.bash_profile, ~/.bash_login, or ~/.profile files in the user directory, in the following order: ~/.bash_ Profile, ~/.bash_login, ~/.profile. If the ~/.bash_profile file exists, the ~/.BASHRC file is typically executed. Therefore, ~/.BASHRC will call the/ETC/BASHRC file. Finally, when you exit the shell, the ~/.bash_logout file is also executed.
So the order of execution is:/etc/profile---(~/.bash_profile | ~/.bash_login | ~/.profile), ~/.bashrc->/ETC/BASHRC, ~/.b Ash_logout
4. Access Environment variables:
Two. Ubuntu Software Operation Command:
1.APT Package Common management operations
install software command: sudo apt-get install softwarename update software Information data command: sudo apt-get Update updates all installed packages command: sudo apt-get upgrade Upgrade the system to the new version command: sudo apt-get dist- upgrade Uninstall Software command: sudo apt-get remove Sofawarename Uninstall and Clear configuration command: sudo apt- get Remove--purge sofawarename automatically removes long-term unwanted software sudo apt autoremove fix dependent command sudo apt-get -F Install
2.deb package installation, creating and managing package creation commands
---P Package.deb (p to uppercase) or Sudo-r--L
3. Packaging with the tar command
-ZXVF * * *. tar.gz extract file to File command :-zxvf ***.tar.gz-c Specify files (C to capitalize)
4. Permissions Management for files
View Permissions command: sudo ls-l filenameubuntu the command to set permissions is: A total of 10 digits of which: the front one-represents the middle of the type that three rw-represents is the owner (user) and then that three rw-is represented by the cluster (group) finally that three r-- Represents the other person (other) after 9 digits: R means that the file can be read (read) w indicates that the file can be written (write) x indicates that the file can be executed (if it is a program)-indicates that the corresponding permission has not been granted permission to modify the file or folder The first command: chmod [-R ] [u/g/o/a] [+/-/=] [r/w/x] filename The second command: chmod [-R] [xyz] file where x, Y, z represent numbers (maximum no more than 7), respectively, and corresponding to the user, Group , Otheru represents user, that is, the owner of the file or directory G indicates that the file or directory belongs to the group O for other, that is, other user a means all, and all Users + represents an increase of permissions-to cancel the permission = Set the permission range R for read, that is read permission, the number code is "4" W means write, which is written, the number is "2" x for running the file, and the number is "1" where:-r means to recursively recursively the entire folder of sub-files
5. Some small commands:
Install the package with the extension. sh command: sudo su-c ' sh xxx.sh ' where SH must add area screenshot command: SHIFT+PRTSC (my screenshot key) View network interface command: sudo ifconfig flush DNS cache command: sudo rcnscd rest Art View Mount Disk command: sudo fdisk-l
Summary operation of Ubuntu operating system