1, describe the CENTOS6 system boot process;
Post Power-----MBR boot------Load kernel-----Start init in and out
Read/etc/initlab file
Initializing the/etc/rc.d/rc.sysinit script
Execute/ETC/RC.D/RC Script
Execute/etc/rc.d/rc.local Script
Execute/bin/login program, enter login status
2, Description/etc/rc.d/sysinit script function;
Get the network environment and host type, first read the network environment settings file "/etc/sysconfig/network", get the host name and default gateway information
Welcome message to the file of consent
Mount the file system defined in the/etc/fstab file
Activate swap
Check the root file system and reload it as read-write
Decide whether to start SELinux mode
Detection of interface devices and testing of Plug and Play (PNP) parameters.
User-defined module loading. The user can then "/etc/sysconfig/modules/*.modules" to add a custom module, which will be loaded into the system.
Loads the relevant settings for the core. Press "/etc/sysctl.conf" to configure the function for the setting value of this file.
Set the system time (clock).
Sets the font style for the console of the terminal.
Set up HDD features such as RAID and LVM.
View the test disk file system in a way.
The conversion to disk quota quota.
Re-loading the system disk in read mode.
Start the quota feature.
Start the system random number device (generate random number function).
Clear the temporary files during the startup process.
Load the startup information into the "/VAR/LOG/DMESG" file.
3. Summarize the usage of the Text Processing tool sed and awk;
Sed
: Expression-Addressable
N: No output by default
P: Print
Example:
#打印包含TEM的行
Sed-ne '/tem/p ' gc.txt
H: Append to hold Space
D: Multi-row deletion
$: Last line
!: Take counter
G: Space coverage mode from the hold space
s:/is replaced/replaced/
Example:
#删除所有换行符
Sed ' h;$! D;g;s/\n//g '
Awk
awk '/Regular expression/{process} ' input file
$ full Line The first field $NF the last 1 fields
Here is a section of the MySQL database code on line
Slave_stat= ($ ($slave _tool-e "show slave status\g" |grep Running |awk ' {print $} '))
4, write a script, generate 10 random numbers, and according to the order from small to large (requires at least 2 Chinese law);
For i in ' seq 1 ';d o echo $RANDOM;d One | Sort-n
5. Execute the script/data/get_username.sh at 1:5 A.M. every Tuesday and output the script to the/tmp/get_username.log log file;
/usr/bin/mysqldump-uclient-p**************** jzjz >/data/mysqlbak/' Date +%y%m%d '. sql
If [$?-eq 0];then
echo "Backup OK" >>/tmp/log/mysqlbak.log
Else
echo "Backup Error" >>/tmp/log/mysqlbak.log
Fi
Cortab-e
0 2 * * */data/mysqlbak/backup_mysql.sh
6. Write a script: If a path does not exist, it is created as a directory, otherwise it is present, and the content type is displayed;
#!/bin/bash
#
If [-Z $];then
echo "Usage:$0 <path>"
Exit 1
Fi
if [!-D $];then
Mkdir-p $
Else
echo "is exists."
File $
Fi
7, write a script, print 9x9 multiplication table;
#!/bin/bash
For I in 1 2 3 4 5 6 7 8 9;d o
For j in 1 2 3 4 5 6 7 8 9;d o
printf "%2d" $ ((i*j))
Done
Echo
Done
8, describe the work flow of DNS, as well as a complete set of DNS master-slave server, the relevant domain name and IP can be set by itself.
This article is from the "Learning Exchange" blog, please be sure to keep this source http://725689.blog.51cto.com/715689/1740893
Linux OPS Practice-January 19, 2016-February 3 course Assignments