Most of the first week of training is not as ripe as it used to be. Think about it and memorize it again. ---Q
-----------------------------------------------------------------------------------------------------
1, boot process 2, Disk Management 3, File rights control 4, Process Control 5, RPM package use 6, Network and Configuration 7, common commands
"Boot-up process"
http://beibing.blog.51cto.com/10693373/1695986
1. BIOS power-On (HDD, CD, network, etc.) [HD HDD boot]
MBR Master boot Record
Hard disk Top 512 bytes 446 (bootloader) +64 (DPT partition Table) +2 (Aa55 magic digit check digit)
Backup Mbrdd if=/dev/sda of=/tmp/mbrdump bs=512 count=1
View Mbrhexdump Mbrdump
Stage1---stage1_5 (63 sector drive and file system)-->stage2 (True bootloader to find grub.conf)
2, read bootloader (boot grub, etc.)
Grub--/etc/grub.conf decide which kernel to start
Default=0 #默认启动第一个titletimeout =5 #显示菜单的超时时间 The default unit is Hiddenmenu #启动的时候隐藏菜单splashimage #指定开机启动时的背影图案title #必须要写
Root (hd0,0) The first partition of the first hard drive is the/boot
Kernel (the kernel is where the kernel file is located)/(refers to the/boot directory) Vmlinuz-2.6.18-194.el5 ro (read-only) root=label=/(System is the root of the real) RHGB (graphically display and display the progress bar) quiet ( Show only important information hardware, etc. returned information is not displayed)
INITRD (First load init and then load each module)/initrd-2.6.18-194.el5.img
Simulate a corrupted boot program
Damage DD If/dev/zero of=/dev/hdb bs=446 count=1
Repair GRUB-INSTALL/DEV/HDB The current system is on the hard drive generation stage file
3. Boot the kernel
Locate the kernel through the grub.conf file and load the kernel into memory
4, the kernel to find the first process of the system init
/sbin/init =>/etc/inittab
First startup script/etc/rc.d/rc.sysinit
Initializing the System/etc/rc.d/rc--(0-6)
What each runlevel needs to start is at the beginning of the corresponding directory S STARTK, which is kill
5. Rc.sysinit initialization Process--rc.0-6 initialization system--rc.local Initialize final script
Rc.sysinit mainly do the same initialization work in each mode of operation including path, network configuration, Fstab, proc, etc.
6. Loading this resource
7. Loading graphical interface
Disc Repair Linux Rescue
Chroot/mnt/sysimage//Switch the root directory to the hard disk
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/89/75/wKioL1gUQ--h-gztAANWBa5ERiY175.png-wh_500x0-wm_3 -wmp_4-s_3264897677.png "title=" image 1.png "alt=" Wkiol1guq--h-gztaanwba5eriy175.png-wh_50 "/>
"Disk Management"
http://beibing.blog.51cto.com/10693373/1696576
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/89/75/wKioL1gURQSTTyQzAAGku6oz-1Y236.png "title=" 2.png " Style= "width:600px;height:300px", "alt=" Wkiol1gurqsttyqzaagku6oz-1y236.png "height=" width= "0" vspace= " Hspace= "0" border= "0"/>
Format Disk Mkfs.ext4/dev/sda5
Mount Disk Mount/dev/sda5/data | | Mount-a
Unmount disk Umount/data//cannot be deleted if it is under disk or has process consumption
View Mounted Fdisk-l | | Mount
Disk space df-h
Auto mount Modify configuration file Vim/etc/fstab
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/89/78/wKiom1gUR1PAsjpOAABfNQ3mPzw451.png "title=" 3.png " Style= "width:650px;height:151px;" alt= "Wkiom1gur1pasjpoaabfnq3mpzw451.png" height= "151" width= "650" vspace= "0" Hspace= "0" border= "0"/>
Format mount device mount directory file system default mount parameter boot backup file system 0 unprepared 1 standby boot check 0 not 1 check
"Permission Control"
http://beibing.blog.51cto.com/10693373/1695473
Absolute Path = = Access relative path starting from root = = Access starting at the current location
Basic Permissions rwx==421
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/89/76/wKioL1gUSg2jAbUAAACmpiliGXE057.png-wh_500x0-wm_3 -wmp_4-s_3423410603.png "title=" 4 pictures 2.png "alt=" Wkiol1gusg2jabuaaacmpiligxe057.png-wh_50 "/>
chmod [Augo (+-=)][777] File or directory//Add-R to change permissions recursively
chattr [+-=][Options] File or directory name && lsattr file or directory
The file settings I lock file cannot be deleted cannot be changed
Directory settings I can only modify the files in the directory can not delete the file cannot be changed
Set A to file a can only increase the data can not be deleted can not be changed even if the data can only be added with Echo content >> file name
Set a: Allow only file modification data not allowed to delete
Suid && GUID && sbit//Very serious general shadow is that other users cannot see but can change the password
chmod [ugo+-=]s file or directory
Setfacl-m U:ZABBIX:RW files or directories//read/write permissions to Zabbix users
Setfacl-x U:zabbix file or directory//delete Zabbix user permissions on this directory
Setfacl-b file or directory//clear permissions for this file or directory
Concepts for users and groups
User Superuser root, ordinary user Tengxun, virtual user Nobody, System user within 500
/ETC/PASSWD 7 column format
User name: Password: User id: Group identification number: Annotative Description: Home directory: Default Shell
/etc/shadow 8 column Format
Login Name: Password: Last modified: Change password minimum time: Maximum time interval: Warning Time: Inactivity time: Expiry time
/etc/group 4 paragraph format
User group name: User group password: GID: User list
Add account useradd parameter user name//-g Primary Group-G secondary Group-D specify hone-p specify password
Delete Account Userdel-r username//delete user and home directory
Create Group Groupadd Group name
Delete Group Groupdel group name
Change Permissions Usermod-a-G Groupa user//Add user user to Groupa group
Group Delete user gpasswd-d test root//Remove test user in root group
Soft and Hard links
Hard ln-s source file destination file//equivalent shortcut does not occupy space
Soft ln source file destination file//same innode point to same data block does not support Kua partition
"Process Management"
Show All Processes PS aux
Show user Process ps-f-u www
Specify name process ps-c MySQL
CPU sort process ps aux--sort=-pcpu |head//-pcpu descending pcpu ascending pmem memory sort
Show parent-child process ps-f--forest-c MySQL
Show only child processes Ps-o pid,uname,comm-c MySQL
Child Check the parent process PS--ppid 2359
Look at the thread of the process ps-p 2359-l
Show process time Ps-p 2359-o Pid,ppid,comm,etime,time
Real-time capture process watch-n 1 ' ps-e-o pid,uname,cmd,pmem,pcpu--sort=-pmem,-pcpu | Head
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/89/77/wKioL1gUWt-B5x1WAACaam_9oeA159.png "title=" 5.png " Style= "WIDTH:400PX;HEIGHT:323PX;" alt= "Wkiol1guwt-b5x1waacaam_9oea159.png" height= "323" width= "0" vspace= " Hspace= "0" border= "0"/>
Put it in the background sleep &
Pause Process Ctrl + Z//pause a running process and put it behind the scenes BG will turn the process into background to continue execution
View background jobs
Adjust to foreground FG ID number
Screen command//yum install-y screen
-V Displays version information.
-X Offline screen jobs before recovery
-H < number of rows > number of buffer rows in the specified window
-ls or--list shows all of the current screen jobs
-R < Job name > restore offline screen jobs
-S < job name > Specify the name of the screen job
-s Specifies the shell to be executed when the new window is created
-D < Job name > take the specified screen job offline.
-M forces a new screen job to be created even if the screen job is currently in operation
-wipe Check all current screen jobs and delete screen jobs that are not already available
-R first attempt to recover the offline job. Create a new screen job if you cannot find an offline job.
"RPM Package Use"
http://beibing.blog.51cto.com/10693373/1695118
Install the RPM-IVH package name
Query Rpm-qa |GREP Package name
Check RPM-IVH--test Package name//used to check that dependencies are not really installed
Upgrade Package RPM-UVH Package Name
Unload Package RPM-E Package name
Check the installation path RPM-QL package name
Check specific information Rpm-qi package name
Check Dependency RPM-QPR Package name
"Network Configuration"
1, Ifconfig
2. IP
3, mtrmtr 8.8.8.8
4, Routeroute Add [-net|-host] [network or host] netmask [mask] [Gw|dev]
-N Do not use the communication contract or host name directly using IP or port Number-ee to display the associated parameters of Add and delete (DEL) routes using more detailed information-net indicates that the route followed is a domain-host represents the back Connected to a single host of the route netmask with the domain can be set netmask determine the size of the domain GW gateway followed by the number of IP values and dev different dev if only to specify that a network card connected to the back of the network Card equipment, etc.
Route add-net 192.56.76.0 netmask 255.255.255.0 Dev eth0
Route add default GW IP
"Common Commands"
The usual commands don't go into the category of my command module to see it.
1, locate
2. Find
3. grep
.......................................
Wonderful poly Training (i.)