Compression command:
*. Z compress program zookeeper case;
*. Bz2 Bzip2 program zookeeper case;
*. GZ gzip program upload history case;
* The resources packaged by the. Tar program have not been deleted;
* .Tar.gz tar program packaging example, which has passed the gzip example
Compress filename compressed file plus [-D] uncompress
Gzip filename compression plus [-D] decompress zcat 123.gz to view the compressed file content
Bzip2-Z filename compression plus [-D] unzip bzcat filename.bz2 to view the compressed file content
Tar-CVF/home/123.tar/etc package without compression
Tar-xvf 123.tar unpacks
Tar-zxvf/home/123.tar.gz unzip with Gzip
Extract tar-jxvf/home/123.tar.bz2 with Bzip2
Tar-ztvf/tmp/etc.tar.gz view tar content
Cpio-covb> parts
Cpio-icduv <Restoration
Common VI usage
General mode edit mode command mode
H left a, I, R, O, A, I, R, O: W save
Enter edit mode under J: W! Force save
On K, DD deletes the current row of the cursor: Q! Do not save and exit
L right NDD Delete n rows: WQ! Save and exit
0 move to the beginning of the row YY copy the current row: E! Restore original file
$ Copy n rows to the end of the row: W filename save
H. paste P and P at the top of the screen: Set nu to set the row number.
M screen center U undo: Set Nonu cancel row number
L click [CTRL] + R at the bottom of the screen to redo the last action ZZ and save and exit.
The last line of the G file [CTRL] + Z is paused and exited: Set nohlsearch permanently disables the highlighted display
/Work downward search: SP opens two documents at the same time
? Work: Search [CTRL] + W for two documents
Move Gg to the first row of the file: nohlsearch temporarily disables highlight
Understanding Shell
Alias displays all current command aliases alias LM = "ls-Al" command aliases unalias lm cancelling command aliases
Type is similar to which
Exprot to set or display environment variables
Exprot Path = "$ path":/sbin Add/sbin path
Echo $ path: Display path
Bash entry subroutine
Name = Yang variable
Unset name cancel variable
Echo $ name: DISPLAY variable content
Myname = "$ name its me" & myname = '$ name its me' when the single quotation mark $ name loses the variable content
CIW =/etc/sysconfig/network-scripts/set the path
Env: list all environment variables
Echo $ random
Set shell settings
PS1 = '[/u @/h/W/A #/#]/$' specifies the character to be prompted.
[Root @ Linux ~] # Read [-pt] variable ----------- read the input variables on the keyboard
Metric data:
-P: the backend can be followed by a prompt character!
-T: the backend can be connected to the "seconds !』
Declare declares shell Variables
Ulimit-A displays all restrictions
Ls/tmp/Yang & Echo "exist" | echo "not exist"
This means that when ls/tmp/yang completes the row, if it is correct, Echo "exist" will be executed. If there is a problem, Echo "not exist" will be performed"
Echo $ PATH | cut-d': '-F 5 uses the separator to read the content of section 5th.
Export | cut-C 10-20 read 10th-20 bytes
Last | grep 'root'
CAT/etc/passwd | sort display
CAT/etc/passwd | WC displays "lines, words, and bytes 』
Regular Representation
[Root @ test root] # grep [-acinv] 'search for character string' filename
Data Description:
-A: Search for data in the binary classification case by text encoding.
-C: count the number of times that the 'search for character string' is found.
-I: Ignore the difference in the size of the shard, so the size of the Shard is the same
-N
-V: indicates the reverse selection, that is, the row without the 'search character string' content!
Grep-N '123.txt search for the character ----------- search for a specific string
Grep-n't [EA] st'123.txt search for test or taste characters --------- use [] to search for a collection character
Grep-n '[^ g] oo '123.txt search for oo ----------- selected from G before [^]
Grep-n '[0-9] '123.txt search for numbers with 0-9
Grep-n '^ The '123.txt Search Start With the row ----------- start of the row search ^
Grep-n' ^ [^ A-Za-Z] '123.txt search does not start with an English letter
Grep-n' [A-Z] $ '123.txt search for rows ending with a-Z ---------- search at the end of a row $
Grep-N 'G .. d' 123.txt Search Start with G and end with D character ---------- any character.
Grep-N 'ooo * '123.txt search contains at least two oo characters --------- duplicate character *
Sed text stream editor uses script commands to process text files
AWD mode scan and processing language
NL 123.txt | sed '2, 5d 'Delete content from the second row to the fifth row
Differences between diff and files
CMP compares two files
Patch file
Format the file to be printed by PR
Account Management
/Etc/passwd SYSTEM account information
/Etc/shadow account password information is encrypted by MD5 32-bit
Add "*" in front of the password column 『*』『! "Forbidden to use an account
/Etc/group system group information
/Etc/gshadow
Newgrp change logon Group
Useradd & adduser create new user ---------> useradd-M test automatically create the user's login directory
Useradd-m-g pgroup test ---------> specify the level
/Etc/default/useradd settings
/Etc/login. defs UID/GID
Passwd Change Password -----------> passwd Test
Usermod
Userdel Delete account -----------> userdel-r Test
Change the shell [-L] used when logging on to the system using CHSH to display the available shell; [-S] modify your own shell.
Chfn changes the information displayed by the finger command
Finger finds and displays user information
ID Display User ID -----------> ID Test
Groupadd add Group
Groupmod is similar to usermod.
Groupdel Delete Group
Su test changes Su-to root and uses the root environment variable.
Sudo executes commands in other identities
Visudo edit/etc/sudoers and add a line "test all = (all) All 』
% Wheel all = (all) All users in all the wheel groups in the system can use sudo.
% Wheel all = (all) nopasswd: all users in the wheel group do not use the nopasswd password.
User_alias admpw = vbird, dmtsai, vbird1, and vbird3 are added to the admpw group.
Admpw all = nopasswd :! /Usr/bin/passwd,/usr/bin/passwd [A-Za-Z] *,/
! /Usr/bin/passwd root can change the user password, but cannot change the root password (add it before the command! Cannot represent)
Pam (Pluggable Authentication Modules, embedded Mode)
Who & W view who is online
Last recent host login information
Lastlog recent logon time read/var/log/lastlog
Talk with other users
Write sending information write test [CTRL] + D send
Mesg sets the write permission for the terminal. mesg n prohibits receiving mesg y.
Wall sends a message to all users. Wall this is q test
Mail write mail
/Etc/default/useradd home directory default settings
Quota displays the space used by the disk and the limit quota-guvs -----> shows the current limit of the root user's quota.
Quota-vu Query
Quotacheck checks disk space usage and limits. quotacheck-avug -----> performs a preview of all partitions in the/etc/mtab containing the partition supported by quota.
[-M] force Scan
Quota must be an independent partition. There must be two files, quota. User and quota. Group. Add the following to/etc/fstab:
/Dev/hda3/home ext3 defaults, usrquota, kgquota 1 2
The chmod 600 quota * setting is complete and the restart takes effect.
Edquota edits the quota [u] user of a user or group, [g] group, [p] copy, and [T] sets the grace period.
Edquota-A Yang edquota-P Yang-u young -----> copy
Quotaon enable disk space limit quotaon-auvg --------> activate all filesystems with quota
Quotaoff disk space limit quotaoff-A --------> the quota limit is disabled.
Repquota-AV: Query quota of all filesystems with quota in the kernel system.
The main steps for quota from starting filesystem support to the end of the entire configuration are as follows:
1. Set the filesystem of partition to support quota metrics:
Quota must support the filesystem on partition. Generally, ext2/ext3 is the best support level,
I have never heard of other filesystem-type programmers! When the filesystem supports quota, the simplest option is always using/etc/fstab,
This allows the specified volume to be enabled to support the quota volume;
2. Create a quota Reporter:
Previous attempts have been made, and the entire quota drive limit is stored in aquota. User/aquota. Group,
To create these two cases, you must first use quotacheck for scanning!
3. Quota quota restrictions:
In addition, edquota is used to allocate the available space for each user or group;
4. Repeat and trigger quota:
After setting the quota, we recommend that you perform the quotacheck operation again, and then use quotaon to activate it!
Boot Process Overview
1. Import the hardware information of the bios and obtain the first token on the server;
2. Retrieve the startup information of the boot loader (Lilo, grub, spfdisk, etc.) of the First MBR on the machine;
3. Access the core information of the kernel operating system. The kernel starts to solve the problem and updates all hardware settings;
4. Run the INIT program and obtain the Run-level information;
5. init upload/etc/rc. d/rc. sysinit commit case;
6. External topology of the animation core (/etc/modprobe. conf );
7. init each batch (scripts) of the run-level line );
8. init upload/etc/rc. d/rc. Local upload;
9. Click the/bin/login program and wait for the user to log on;
10. log on to the console and start using shell to control the host.
In/etc/rc. d/rc3.d, start the instance starting with S, stop the instance starting with K, and then the number indicates the execution order.
Grub VGA settings
Color/Resolution 640x480 800x600 1024x768 1280x1024 bit
256 769 771 773 775 8 bit
32768 784 787 790 793 15 bit
65536 785 788 791 794 16 Bit
16.8 M 786 789 792 795 32 bit
./Configure check system information./configure -- help | more help information
Make clean clear the files left before
Make Compilation
Make install Installation
Rpm-Q -----> check whether rpm-Ql is installed ------> query all directories of this suite
Rpm-Qi -----> description of the query suite rpm-QC [d] -----> configuration file and description file
Rpm-IVH ----> install rpm-V --------> check whether the kit has been updated.
Rpm-e ------> Delete rpm-uvh -------> Upgrade and install
-- Nodeps -----> force installation -- Test -----> test installation