Common options for Uniq commandsRemove Duplicate rows-U display non-repeating rows-D shows duplicate rows-C Print the number of repetitions per lineThe test text content is as follows:# Cat 4.txt11111122222222333333334444(1) Uniq# Cat 4.txt | Uniq
Cut command common optionsThe test text content is as follows:# cat Name1.txt name1 alvin1name2 alvin2name3 alvin3name4 alvin4# cat 2.txt name1:100name2:101name3:102(1)-CCut the 1th character of each column# Cat Name1.txt | Cut-c1NNNNCut the 1th, 3-4
The test text content is as follows:# cat Name1.txt name1 alvin1name2 alvin2name3 alvin3name4 alvin4# cat name2.txt name1 100name2 101name3 102CCCCCCCCCCCCCCC C(1) Paste merge each line of two files by one by one# paste Name1.txt name2.txtname1
Topic linksDp[n] = Sigma (A[i]*dp[n-i]), given a1.....an, Dp[n]. N is 1e5.The form of this equation is obviously a convolution, so you can use the FFT to optimize it, but this will also time out. So you can use the CDQ to optimize the partition.CDQ
In the shell, arguments can be passed to a function when it is called. Inside the function body, the value of the parameter is obtained in the form of a $n, for example, "$" for the first argument, and $ for the second
The For loop works by taking the element one by one of the serial element out, putting it into the set variable sequentially, and then repeating the enclosed command area (between do and done) until all the elements have been exhausted.Where serial
First, several commands are elaborated.Echo $ shows the currently used shell versionDpkg-reconfigure Setting the package typeThe reason why the newspaper is wrong:The default shell parsing used by Ubuntu is a feature that Dash,dash only part of
Syntax structure of case:Case to test item in style string 1] command area 1;;( Style string 2) command area 2;; Style string 3) command area 3;; *) command area;; Esac
Command area, can be a single instruction or multi-line instruction, but
1.declare commandDeclare declaring variable type: Declare [+/-][option] Variable name-: Set type attribute to variable+: Cancels the Type property of a variable-A: Declaring a variable as an array-I: Integer-X: Environment variables-R: Read-only
There are a number of ways to intercept strings in the shell, ${expression} There are 9 ways to use them. ${parameter:-word}${parameter:=word}${parameter:?word}${parameter:+word} The above 4 alternatives can be used for default values. ${#parameter}
Environment variables
$HOME
Home directory of the current user
$PATH
A colon-delimited list of directories to search for commands
$PS 1
A command prompt, usually a $ character, but in bash,
Using shell scripts to check service opening conditions#!/bin/bash# need to install Yum install Nmap first-y# checks whether the specified port is on function checkportstatus () {Status= ' Nmap-ss127.0.0.1-P $1| grep Open | Awk'{print $}'` if[
Parse the scrambled log file into the temp file, then use the AWK1004CD/USR/LOCAL1005LL1006CD pttmsg/ 1007 ll 1008 cd msgbin-2/ 1009 ll 1010 cd proxy 1011 ll 1012 cd log 1013 ll 1014 tail -1000 proxy_sub0_20160107.log 1015 grep ' = = =
I rookie a, first contact with the Linux shell script;Shell script, the simplest function is to write a lot of instructions together, so that users can easily be able to execute multiple commands, and shell script provides arrays, loops, conditions
backgroundsed is a good file processing tool, itself is a pipeline command, mainly in the behavior of the unit processing, you can replace the data rows, delete, add, select and other specific work.SED is intended to be a stream editor (Streameditor)
Common shell variables are: custom variables, environment variables, positional variables, predefined variables, and so on.Variables: Can be stored in a variable value of space, can be changed by different environments, is a variable value. Echo
In summary, the development system is OS X 10.11.4, the tool is ITerm2, and the practice is currently based solely on that environment.1. Most commonly usedCmd+c: CopyCmd+v: PastingTAB: ComplementCTRL + A: Move to command start positionCtrl+e: Move
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