Linux notes (below)

Source: Internet
Author: User

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 # \ #] \ $' prompt character settings

[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': '-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 string' filename

Parameter description:

-A: searches binary files for data 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 '123.txt search the character ----------- search for a specific string

Grep-n't [EA] st'123.txt search for two characters: test or taste --------- use [] to search for collection characters

Grep-n '[^ g] oo '123.txt search oo ----------- select [^]

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 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 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 as 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 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.

Partition for scanning

[-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 --------> Start 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 from preparing filesystem support for quota to completing the configuration are as follows:

1. Set the filesystem of partition to support the quota parameter:

Since quota must be supported by the filesystem on partition, in general, the best support is ext2/ext3,

I have never tried other filesystem-type laruence! The easiest way to enable filesystem to support quota is to edit/etc/fstab,

So that the quota disk to be opened can support 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 data of quota:

Then, you can use edquota to edit the available space of each user or group;

4. Review and start quota:

After setting quota, we recommend that you perform quotacheck again and start it with quotaon!

Boot Process Overview

1. Load BIOS hardware information and obtain the code of the first boot device;

2. Read the 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. Start the core plug-in Module (/etc/modprobe. conf );

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

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

 

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.