Security code: Green, take it to blue and green Bluetooth, ice, water for the cold and cold in the water
Dear friends, this time is divided into 6 updates, a total of 12 chapters, please be sure to warm and understand the new, heavy digestion understanding, master the Linux basic concepts and commands
First, Linux system Management and maintenance
1. Partition:/boot (100-200m)
Swap: (swap partition, 1.5-twice times the recommended physical partition)
/: Remaining space
Root is an administrator user, distinguished from administrator
2. Suggestions for beginners: close iptables
A, chkconfig iptables off
B. Open the/etc/sysconfig/selinux file, modify "Selinux=disabled", Save and exit
Note: Both items are closed, and then the reboot restart takes effect.
3. MBR Boot:
0 cylinders on Disk 0 Tracks 1 sectors, total 512 bytes
512=446+64+2 (446 bytes is the Grub Bootstrapper, 64 bytes is the partition table, and 2 bytes is the end tag)
Grub Menu: The corresponding file is/boot/grub/grub.conf
Load kernel: The file of the kernel is in/boot
4. Init process: Run/sbin/init loaded by Linux kernel
Is the first process in the system, the PID number is always 1
5. Configure the default operating level:/etc/inittab
Example: Ctrl+alt+del hotkey operation under the/etc/init/control-alt-delete.conf control terminal
6, Runlevels (operating level): 0 Shutdown 6 Restart 5 graphics, 3 full character, 2 does not support network characters,
1 (single user, that is, no password to log in, more for system maintenance), 4 unassigned, generally do not use
Use of VI: VIM file name
Press the I key--Modify the content--press ESC to--:WQ (save and exit), Plus! Represents a mandatory execution.
7, the control of the service:
Method One: Service Name Heng control type
Method Two:/etc/rc.d/init.d/Service name control type
Control type: Start|stop|restart|reload (Heavy Duty) |status (View status)
Example: restarting the Network Service
Service Network restart
or/etc/rc.d/init.d/network restart
8. Check the current operating level: RunLevel
System Services management tool (control power-on self-boot):
(1) Ntsysv: Interactive, with menu options. Press space to enable or disable, TAB toggle
(2) Chkconfig: pure Command configuration
To view the default startup status for the current service: Chkconfig--list
Modify the service at a certain level of boot-up: Chkconfig--level level service name on (or off)
Prevent conflicts, as shown in the notes:
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/86/5C/wKiom1e9HfWBqCKOAAKOLnb_GPQ182.png-wh_500x0-wm_3 -wmp_4-s_2271914708.png "title=" E481421efeffe23f1f4c615087dbfa8f.png "alt=" Wkiom1e9hfwbqckoaakolnb_gpq182.png-wh _50 "/>
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/86/5B/wKioL1e9HlWzO1FsAAKPBbryfL0741.png-wh_500x0-wm_3 -wmp_4-s_3080736244.png "title=" 0fbc762a44ebe38faf26ac4e3afa8660.png "alt=" Wkiol1e9hlwzo1fsaakpbbryfl0741.png-wh _50 "/>
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/86/5C/wKiom1e9Ho6BJ8NsAALmIvSaGlg025.png-wh_500x0-wm_3 -wmp_4-s_1611730762.png "title=" 2792c4a65134215cbf95719553eb748e.png "alt=" Wkiom1e9ho6bj8nsaalmivsaglg025.png-wh _50 "/>
Ii. Directory and document management
1. View the contents of the file:
Cat: Display the contents of a file (only the last screen if there is more content)
MORE: Split screen display file
Less: Split-screen display of file content, but extended functionality
Head: Just look at the top of the file (first line down), Head-n (n can be interpreted as the number of pages)
Tail: Look at the end of the file (same head, in reverse order)
For example:; shift + PAGE UP (down), tail-f: trace log file
2. WC command: Statistics file content (-L line,-C byte,-w number of words)
3. grep command: Retrieve and filter file contents
Common Command options:-I ignores case when looking,-V reverses lookup, and outputs rows that do not match the find criteria
Find condition settings: A. The characters to find are enclosed in double quotation marks
B. " ^ ... "means to ... The beginning, "... $" means ... End
C. " ^$ "represents a blank line
4, compression and decompression (only for file compression)
A. Compression (file)
Gzip file name (the compressed suffix is GZ)
BZIP2 file name (compressed file is bz2)
B. Unzip
Unzip GZ:
Gzip-d or Gunzip
Decompression bz2:
Bzip2-d or BUNZIP2
Make a large file: Cat/dev/zero > File name (Ctrl + C end)
5. Archive and Compress tar (files or folders)
A. Archive and compress
Tar Czf. tar.gz files or directories that need to be compressed (compressed into GZ format)
Tar cjf. tar.bz2 files or directories that need to be compressed (compressed to BZ2 format)
B. Unzip
Unzip. tar.gz:
Tar zxf. tar.gz file
Unzip. tar.bz2
Tar xjf. tar.bz2 file
Decompression options: (-C target location) Note: C is uppercase
6, VI Editor
Use of VI:
A.VI three modes and modes of switching:
Cursor Movement: #G (Specifies which row to jump to)
Copy (yy or #yy indicates which row to start copying from), paste (P), delete (x means delete
Delete a character and dd or #dd to delete the row)
Find:/find content (top to bottom),? Find what to look for (from bottom to top)
Undo: D, if a single character is undone, u
B. Using in the last line mode:
Display line number (: Set Nu), (: Set Nonu means cancel)
Save and exit: W save, Q Exit, Wq means save and exit, add! Represents a mandatory execution
Find and Replace: (:% s/old/new/g)
Note:%--represents the entire document, g--represents the entire line
Replace all strings in the line number "#,#" Range: (: #,# s/old/new/g)
Prevent conflicts, as shown in the notes:
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/86/5C/wKioL1e9KaSCQJXeAAKJ36Vj-o4477.png-wh_500x0-wm_3 -wmp_4-s_492100.png "title=" 554a6996af5f5bd6f88234516a4daa3e.png "alt=" Wkiol1e9kascqjxeaakj36vj-o4477.png-wh_50 " />
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/86/5C/wKioL1e9KbmTyEStAAGNeai9O2I314.png-wh_500x0-wm_3 -wmp_4-s_2058405816.png "title=" C9a72f1a6c9164fba082a47d80dce06b.png "alt=" Wkiol1e9kbmtyestaagneai9o2i314.png-wh _50 "/>
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/86/5D/wKiom1e9Kc6B-L4rAAErsylON-E913.png-wh_500x0-wm_3 -wmp_4-s_2212553219.png "title=" 619c69fda0d71977a40f461e857d5c12.png "alt=" Wkiom1e9kc6b-l4raaersylon-e913.png-wh _50 "/>
Thank you for watching, I hope the sincerity can help you!
This article is from "A Candle" blog, please be sure to keep this source http://yw666.blog.51cto.com/11977292/1841924
Linux basic concepts and Personal notes summary (1)