Bird Brother Linux Private cuisine Knowledge points summary 10 to 11 chapters

Source: Internet
Author: User

Recently turned to a "bird brother's Linux private dishes." This is a basic book, lofty high-rise floor, will not much but can learn. This is a few of my knowledge points, although very basic. Hope to share with you.


10th Chapter VIM program editor


Key instructions:

/Word looks down for a string called word

? Word looks up for a string named woed

NDD Delete the down n line where the cursor is located

nyy the down n rows where the cursor is copied

J Combines data from the row of the cursor and the next row into the same row

U Restore previous action

[Ctrl]+rRedo Last Action

ZZ If the file has been altered, save and leave

[Ctrl]+v Block Selection

Multi-window function:
If you want to start another file in a new window, add the file name, or enter only : SPAppears to be the same file between two windows
^ (* ̄ (oo)  ̄) ^ In fact this part is said to say Vim page, copy, War Day command kill. (pasted command on the ground)




11th Chapter Understanding and Learning Bash


first, know the shell of bash
1. The shell will enter ourCommandAndKernel CommunicationSo that the kernel canControl HardwareTo work correctly and without errors.

As long as an interface capable of manipulating an application can be called a shell.

^ (* ̄ (oo)  ̄) ^ Learning language is like practicing magic, a law, Lawspirit.


features of the Bash shell

① can memorize used commands .

② command and file completion function , press tab on the line

③ command alias setting function with alias lm= ' |s a| '

④shell script language

Bash Shell's built-in command:type

Type is functionally similar to which.


Shell's variable function:
The display and setting of the variable: Echounset

① with echo $xxx will be able to get the content of XXX

unset is the name of the cancel variable

③ single quotes vs double quotes: Double quotation marks can still be the contents of the mailing variables , single quotes can only be ordinary characters, there will be no special symbols


features of environment variables:

Use env to view environment variables and common environment variables

Generate random Number:declare-i number= $RANDOM *10/32768;echo $number

The random number can only be generated from 0 to 32767 .

View all variables with set (with environment variables and custom variables)

The child process inherits only the environment variables of the parent process, and the child process does not inherit the custom variables of the parent process

In referencing your own variable set to a later called file or other program, use the expert variable name


variable keyboard reads, arrays and declarations: Read,array,declare:

1. Chat with users read

Read [-PT] Variable

-P: Can be followed by a prompt

-T: Number of seconds to wait


Declare/typeset

declaring variable type -I shaping,-R read-only-change to + can cancel operation

such as: Declare-i sum=1+2+3

Echo $sum


limitation Management with file systems and programs :ulimit

Restricting user system resources: Number of files, CPU time, total memory

Example: Restrict a user to create files below 10MB only

Ulimit-f 10240


command aliases and history commands

Command alias settings:alias,unalias

Example: Alias lm= ' Ls-l | More


Historical command: history

Such as: Writes the current data to Histfile, history-w

Bash Shell's large operating environment

Bash Login and welcome information :/ETC/ISSUR,/ETC/MOTD


2. Data Flow Redirection

① definition: After a command executes, the data that should appear on the screen is transferred to another place.

Black hole in ②/dev/null Trash Bin

such as: find/home-name. Bash RC 2>/dev/null


the basis for the judgment of the Order execution :; , && | |

It's similar to the C language.


pick Command :cut grep


Sort command :sort WC uniq

Sort-M sort by the name of the month

-R to reverse sort

uniq: Lists duplicate data only one display

-C list Occurrences

WC: Calculates the overall data of the output information


character Conversion command :tr,col,join,paste,expand

TR: Delete text of a piece of information, or replace it

Eg: The last output information, lowercase to uppercase last | TR ' [A-z] ' [A-z] '

Delete the colon of the/etc/passwd output information cat/etc/passwd | Tr-d ': '

col: often used to dump the man page into a text file for easy querying

Join: Add two files together with the same row that summarizes the same data

paste: Directly put two lines together, and the Middle tab key to separate

Expand: turn Tab key to space bar


Cut command :split

Eg: Synthesize three files into one cat termcap * >> termcapback

Split into three files cd/tmp; Split-b 300k/etc/termcap termcap


parameter substitution :xargs

Finally, I really like the sentence :

please do not in the most can endure hardship when the choice of ease, no one's youth is on the red carpet through, since the dream to become the other people can not reach the ego, you should choose a belong to their own road, in order to reach the end, pay others can not achieve the effort.




Bird Brother Linux Private cuisine Knowledge points summary 10 to 11 chapters

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.