Linux Installation Introduction
How the Linux system sets the dynamic IP address: http://blog.csdn.net/felixfeng/article/details/51852621
1.linux System Start-up
Kernel boot: BIOS post, detect/boot kernel file
Run init: Ancestor daemon for all processes (boot entry)
Different start-up----> RunLevel required for various applications
0: Shutdown status
1: Single-User working status
2: Multi-user status
3: Full multi-user status
4: Reserved
5:gui mode
6: System shuts down reboot normally
System initialization: Init profile---> Call/etc/rc.d/rc.sysinit (shell scripts that need to run for each runlevel, system initialization tasks, priority tasks)
/etc/rc.d/rc5.d/Connection file (S start parameter run: K stop parameter stops running and then rerun)---->/etc/rc.d/init.d/startup script (Received parameter: Start stop restart status)
System Services sets which daemons to run per run level
Set up a terminal: Init opens 6 terminals, providing a portal for user login only/etc/securetty allows the root user to log in
User Login System: Command line login SSH Login GUI login
Toggle between graphics mode and text mode: CTRL + ALT + F1-F6 CTRL + ALT + F7
Linux shutdown: Half poweroff shutdown-h now restart Shutdown-r now reboot fun useless
2.linux System directory Structure
LS/list system directory structure
With:
/bin store the usual commands
/boot core file for Linux startup
/dev External device (device-to-file)
/etc to store the configuration files and subdirectories required for system management
/Home User Directory
/lib Dynamic Connection Shared library
/lost+found storage System illegally shut down the generated file
/media System identification peripherals are attached to this directory
/mnt Temporary Mount
/OPT placing additional Software
/root Super User Directory
/proc Virtual Directory Memory mapping
/var frequently modified directory: Log
/USR/SRC Kernel Source code
/usr/sbin Super User operating Program management and System daemon
/USR Program Files
/tmp This directory holds some temporary files
3. Forget the password embarrassing
4.linux Telnet
5. File Basic Properties
Display the properties of a file ll
1 File Type D directory-file L link B available for storage interface Device C serial port device
2 Master Permissions rwx
3 Set of Permissions rwx
4 Other Permissions rwx
Root user file permissions do not work
Three commands: chmod read and write execution chgrp change group Chown Change the host, can also change the group
6. Management of files and directories
File operation:
Ls-a all, including hidden files. -D Directory-L property permissions
CD Switch Directory ...
PWD Displays the directory where you are currently pwd-p returns the path that you really pointed to
MKDIR-M permissions-P multi-level directory default permissions rwx r-x r-x
Rmdir-p Deleting a multilevel directory
CP Copy files or directories
RM Remove file or directory-F force does not appear prompt-I interactive mode-R recursive mode
MV move file with directory or modify name-f-i-U update destination file exists, and source is relatively new
File View:
Cat Display file contents-t:tab button ^| Display-V: List of special characters not shown-N: List line numbers
-N: Lists line numbers, contains blank lines-B: Lists line numbers, does not contain line numbers-e: End plus $
-a:vet Combination
Tac backwards shows city dwellers are really playing
NL Display Content control line number display:-W width line number of digits-n RZ right plus 0 display-n rn right no plus 0 display
-B a blank line plus line number
More show more space on behalf of Page down enter represents a downward line: F Displays the document name and line number immediately Q: Exit B: Page back
Less page by page look over
Head-n 3 file name displays first 3 lines
Tail-n 3 file name display after 3 lines default display last 10 bar
7.linux User and User group management
(1) Add user account Useradd-c paragraph description (-D Specify user live directory does not exist create-m)-G user Group-G additional Group-sshell file (-u user number-o option re-use other user's identifier)
Add Group Groupadd Group name
Unified management of user accounts userconf
(2) Userdel-r Sam removes the user and the home directory
(3) User's change Usermod
passwd Setting a password
8.yum Package Management processing dependencies
Common commands
Yum check-update List of all software updates available
Yum Update updates all software
Yum Install/update package_name
Yum list lists all the software that can be installed
Yum Remove Package_name
Yum Search keyword Find packages
Generate cache
Yum Clean All
Yum Makecache
NetEase Yum Source configuration local Yum Warehouse
9.shell an application development shell using shell development
Bash
(1) Hello World
As an executable program:
Executive right chmod +x./test.sh
Executes the script./test.sh
As an interpreter parameter:
/bin/sh test.sh
(2) Shell variables
Your_name= "Runoob.com"
For file in ' ls/etc '
When you assign a value, you don't add it when you use it.
ReadOnly read-only variables
Delete variable unset unset cannot delete read-only variable
Type of variable: environment variable local variable shell variable
Shell string: Single quote as output double quotation mark can have variable, can appear escape character
String manipulation: Echo $greeting $greeting _1
echo ${#string} #输出 4
echo ${string:1:4} # Output Unoo
echo ' expr index ' $string ' is ' # output 8
Shell Annotations: #
Shell string Intercept: # # # #% of where to intercept from where to
(3) Shell parameter $ #传进来的个数 $* display a single string $$ $! [Email protected] Display string array $_ $? exit status
(4) Shell array operation: Reading array reading array length traversing array
(5) Shell operator Expr awk subtraction arithmetic operator 20 \* 20 size equals relational operator []
Boolean operator! -o-a logical operator string operator file test operator
(6) Echo command read input, then execute > Output to file ' output command output-e display results escaped
Single quotation mark double quotes without quotation marks (Halo)
(7) printf command with Format control function format-string is reused%s%d in C language
(8) Test command checks if a condition is set
(9) Flow Control Statement Control statement cannot be empty
If []/test then elif []/test then fi
For Var in ... while read Film dead loop until at least once
Do do
Command Commad
Done
Case command
Echo ' Enter a number from 1 to 4: '
Echo ' The number you entered is: '
Read Anum
Case $aNum in
1) echo ' You have chosen 1 '
;;
2) echo ' You have chosen 2 '
;;
3) echo ' You have chosen 3 '
;;
4) echo ' You have chosen 4 '
;;
*) echo ' You did not enter a number between 1 and 4 '
;; On behalf of break
ESAC//END tag
Jump out of the loop break continue
(10) Function return value can be passed parameter
(11) Files containing files do not need to be executed (haha)
(12) input and Output redirection > File > >> Append
command to open three files: standard input file standard output file standard error file
Suppress output redirection/dev/null (try not to lie to me)
Here Document is used to redirect input to an interactive shell script (there is a risk of using it)
Linux System Day Trip