Linux Operations Learning -5--2016 July 29

Source: Internet
Author: User
Tags lowercase md5 encryption

Format Description:

Operation

Concept

Command

Description and examples

Five Index node

The original data is stored in the Inode table
Each file or directory has a separate Inode number (node numbers are unique within a partition and each partition has its own inode table)

Ls-i View node number
Hard Links
LN F1 DIR/F11 creates a hard link for the F1 file and places it under the Dir folder with the name F11. Cross-device cross-partition cannot be created.

Number of links = number of file names, create multiple hard links for a file is equivalent to a file to take more than one name, modify any one file is equal to all modifications, delete one of the hard links, only the equivalent of deleting one of the name of the file
Directory cannot create hard links

Soft Connect (symbolic Link)
Ln-s F2 F2kuaijiefangshi Creating a soft connection for the F2 file F2kuaijiefangsh

Create a soft connection to the file, the equivalent to create a shortcut to the file, write a soft link, the path of the file must be written clearly (relative to the path of the soft connection, not the current working directory path), the path of the soft connection does not matter

INODE table Structure

The first 12 is the data block, each storage 4k, the 13th is the pointer fast, does not directly point to the data block, can save the 4kx1024=4m file, the 14th is a double pointer block, followed by two pointer block, can be stored 4kx1024x024=4g file, and so on.

Df-i query maximum number of nodes per partition and number of nodes used

When the node number is exhausted, you will also be prompted for full disk space

Exercise: Interpreting the system background action of the CP RM MV command

File command
Flie-f + Document Write the file directory you want to view in the document, you can view
Standard input and output standard output, error

Standard default output in current window, standard output error also in current window

redirect
ls >/dev/pts/0 displays the ls >/testdir/ls.log on the pts0 window to redirect the output to the Ls.log file (no this file will be created, overwriting if present) LS >>/testdir/ls.log Writes information to the Ls.log file, preserving the original content

> is the correct result of redirecting standard output; >=1>
2> is a redirect error message

ls/dev/ddd >/tesedir/dui.log 2>/ Testdir/cuo.log writes the correct information in the command to Dui.log, and the error message is written to Cuo.log

LS/DEV/DDD &>/tesedir/all.log Write all the standard output in the command to All.log
The above command is overwrite
The following command is cumulative
ls/dev/ddd >>/tesedir/ Dui.log 2>>/testdir/cuo.log writes the correct information in the command to Dui.log, and the error message is written to Cuo.log

LS/DEV/DDD &>>/tesedir/all.log Write all the standard output in the command to All.log

Multiple command redirection: Enclose multiple commands in parentheses

Callout input redirection
Cat < F1 The information in the F1 output cat < f1 > F2 output f1 in F2 cat F1 F2 > F3 export f1 F2 content to F3 mail-s Hello Wang writes content after return, ends press. Wang User input Mailmail-s Hello Wang < F1.txt sends the contents of the F1.txt as the body to redirect the cat <<e >f1 until the end of the E-mail Redirect to F1 (the <<+ keyword begins. The end of a separate line of keywords appears again)
TR command

converting and deleting characters

Tr ' A-Z ' A-Z converts all lowercase letters entered into capital letters TR ' A-Z ' A-Z ' < F1 converts all lowercase letters in F1 files to uppercase R ' A-Z ' A-Z ' < F1 > F2 converts all lowercase letters in F1 files F2 to uppercase (the contents of F1 are unchanged)

TR ' abc ' ' XYZ '
TR ' abc ' XY '
TR ' AB ' xyz '

Tr-c ' A-Z ' take anti-tr-d ' abc ' have A/B/C to kill tr-d-c ' abc ' XXX ' < F1 will file F1 in addition to the ABC characters are replaced by xxxtr-s ' x ' merge duplicate x for 1

Tr-d ' \ n ' < F1 to kill the line breaks in the F1 file
Tr ' \ n ' <f1 converts spaces in F1 file to City line

Mail-s Help Root <<end
Hello,i amwhoami
The system version is Here,please help me to check it,thanks!
< /etc/issue
End

Pipeline

The pipeline receives a standard output and cannot be a standard error

Practice using pipelines to read documents and send emails

Ls/err |& tr ' A-Z ' A-Z ' is processed (|&=2>&1) LS |tee f2 to save the LS output to the F2 file, regardless of whether the front is an error, but the foreground also displays the redirected output information do not want to see the last add/dev/null
Categories for users, groups, and permission groups

User's primary group-primary group
The user must belong to one and only one primary group
Group name is the same as the user name, and contains only,,,
A user Wang is created by default in Linux, and a Wang group is created with only Wang one in the group.

View command ID
Configuration files for Linux users and groups

/etc/passwd
/etc/shadow
Example: M:$6$8bhkzfy7pl02tuzk$m9ppdjcf6y8ssx/kfgbmg6mat/z2je. Oj6mao.izesjpww0t5mifxxrtzwlrawfp6/xvlz7mg8y4legiad6me0:17001:0:99999:7:::

$6=SHA512 encryption algorithm $1=MD5 encryption algorithm behind the two $ middle of the thing ($8bhkzfy7pl02tuzk$) is the extension, the purpose is that even if the same password encryption can not be seen to be the same, 17001 represents the time, the following 0 means that the password can be changed at any time, Change to 3 is 3 days later to change. The following is not 99999 for the validity period, 7 for 7 days notice; the second one can fill in the number, on behalf of the expiration date of the account, the time is automatically locked, the format is similar to 17,001 days.


Linux Operations Learning -5--2016 July 29

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.