A very good Linux study note sharing (excellent for getting started with Linux) 2

Source: Internet
Author: User
Tags aliases

Common VI usage
Normal 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 itsme' when single quotes $ name loses 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 #/#]/$' character setting
[Root @ Linux ~] # Read [-pt] variable ----------- read the input variables on the keyboard
Parameters:
-P: Followed by a prompt character!
-T: the number of seconds that can be followed !』
Declare declares shell Variables
Ulimit-A displays all restrictions
Ls/tmp/Yang & Echo "exist" | echo "not exist"
This means that after ls/tmp/yang is executed, if it is correct, Echo "exist" will be executed. If there is a problem, Echo "not exist" will be executed"
Echo $ PATH | cut-d': '-F5 uses the separator: to read the content of section 5th.
Export | cut-C10-20 reads 10th to 20 bytes of content
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 the string' filename
Parameter description:
-A: Search for binary files using text files
-C: calculates the number of times the 'search string' is found.
-I: Case sensitivity is ignored, so the case sensitivity is the same.
-N: returns the row number by the way.
-V: reverse selection, that is, the line without the 'search string' content is displayed!
Grep-N 'the'123.txt search the character ----------- search for a specific string
Grep-N 't?ea=st'123.txt search for test or taste characters --------- use [] to search for collection characters
Grep-N '{{g}oo'123.txt search for oo ----------- that is not 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 --------- repeated characters *
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 a new user ---------> useradd-mtest automatically creates a user's login directory
Useradd-m-g pgroup test ---------> specify the level
/Etc/default/useradd settings
/Etc/login. defs UID/GID settings
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/passwdroot can change the user password, but cannot change the root password (add it before the command! Cannot represent)
Pam (Pluggable Authentication Modules, Embedded Module)
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 the disk space used and limits. quotacheck-avug -----> scans all partitions in the/etc/mtab with 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 600quota * 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-ayang edquota-P Yang-u young -----> copy
Quotaon enable disk space limit quotaon-auvg --------> rotate all filesystems with quota
Quotaoff disk space limit quotaoff-A --------> the quota limit is disabled.
Repquota-AV check the limits of all filesystems with quota in the system
The main steps for quota from the start of standby filesystem support to the end of the configuration are as follows:
1. Set the partition filesystem to support the quota parameter:
Since quota must support the filesystem on partition, in general, ext2/ext3 is the best support level,
I have never tried other filesystem-type laruence! The easiest way to support quota is to edit/etc/fstab,
This allows the standby quota disk to be opened to support the quota;
2. Create a quota record file:
As mentioned earlier, the archive for recording the disk limit value of the entire quota is aquota. User/aquota. Group,
To create these two files, you must first use quotacheck to scan them!
3. Edit the limit value of quota:
Then, edquota is used to edit the available space quota of each user or group;
4. Scanning and refreshing quota:
After setting the quota, we recommend that you perform the quotacheck operation again, and then use quotaon to continue the operation!

Boot Process Overview
1. Load the BIOS hardware information and obtain the code of the first boot device;
2. Read boot information of the MBR Boot Loader (Lilo, grub, spfdisk, etc.) of the first boot device;
3. Load the core information of the Kernel Operating System, start to decompress the kernel, and try to drive all hardware devices;
4. Run the INIT program in the kernel and obtain the Run-level information;
5. Run the/etc/rc. d/rc. sysinit file in init;
6. external memory module (/etc/modprobe. conf) of the compaction core );
7. Run the Run-level batch file (scripts) in init );
8. Run the/etc/rc. d/rc. Local file in init;
9. Run the/bin/login program and wait for the user to log on;
10. After logging in, 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
Makeclean clears previous files
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.