12. Sort commands for Rowssort:1. Sort command-line options:
Options
Describe
-T
Separators between fields
-F
Ignore case when sorting based on character
-K
Define
Seven. grep family: 1. grep exit Status: 0: Indicates success; 1: Indicates that a matching pattern could not be found in the supplied file; 2: Indicates that the file provided in the parameter does not exist. See the example below: /> grep '
Common commands· LS View the files in the current directory· CD into a directory· CD-Jump back to previous directory· CD ~ Enter the current user's personal directory· PWD Output Current path· mkdir new Folder· Touch New File· Find File· ln
#!/bin/bash##!/bin/bash#read-p ' input number ' C #指定抽取的学生人 Number of jw= (' Wang Hao ' Shei Yunsheng ' ke Yang ' He Shingyu ' Repeti soldier ' Dengbellin ' ' Liu Dao ' ' Yang Jidong ' Chu Ziwen ' ' ' Salted fish ' ' Yang Dong ' > Huang Tinghui '
1, test-f file 2, [-F file] 3, [[-F file]][-F file1-a-F file2] logic with [-f file1-o-F file2] logic or [-f file1] && [-f file2] the same as a string operation best double quotes such as-n-z = = = And a space is added to both sides of the equals
The shell file containsThe shell can also contain external scripts in the following syntax format:. FileNameOrSOURCE filenameFor example, create a two shell script.Script 1:test1.sh
url = "Www.baidu.com"
Script 2:test2.sh
.
The problem has been a long time, and has not been sorted out. Remember the last interview when asked how to bulk modify the host name of 1000 machines. Here is a file named 1.txt that is created in bulk for hello.First, install the expectYum
Declare declaring variable type declare [+/-] [option] Variable name-: Set the type attribute to the variable +: cancels the Type property of the variable-A: Declaring variables as arrays-I: declaring variables as integers-x: Declaring a variable as
Diffdiff file File1 to compare two different files-C display rows around the top and bottom-U uniformly output patches in a certain format-R comparison of files in two directoriesPatch File File.path Patching-B Plus-B backup source filesgrepgrep Key
Tag: The shell operator represents the deletion of the first character net article BSP comSuppose there is a variable var=http://www.aaa.com/123.htm.1. # Intercept, delete the left character, leave the right character.Echo ${var#*//}where Var is the
Integer operations in shell scripts are generally implemented by the two instructions of let and expr, such as the variable s plus 1 can be written: let "s = $s + 1" or s= ' expr $s + 1 'The two are not easy to write, but the performance of the
Metacharacters and descriptions commonly used in regular expressions
Metacharacters
Symbol name
Description
\
Back slash
Escape character
|
Pipeline
Or
[]
Linux+shell obtaining and copying the latest backup dataBefore we introduced some script configuration, today we introduce, using shell script How to copy the most recent files in the specified directory to the specified directory, we copy the files
Tag: set command; unset commandFor example: There are now two user-defined variablesName= "Andy Lau"Age=20The set command is used to view variables650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/87/EF/wKioL1fkk0CQqSUwAADT1GLzRuI190.png-wh_
Format: echo "/033[word background color; font color m string/033[control code"If you simply display the font color can be fixed control code bit 0m.Format: echo "/033[word background color; font Color m string/033[0m"Word background color range: 40-
Shell Script Planning TemplatesIn Linux operations, shell scripts are indispensable tools, but each operator programming habits are different, many times is to implement a function, written out of the script is rotten seven or eight bad.Scripts must
Programming languages are generally divided into static languages and dynamic languages.Static language: Compiled language strongly typed (variable) pre-compiledExample: C C + + Java C #Dynamic language: Interpreted language weak type (default
| Copyright Notice: This article for Bo Master original article, without Bo Master permission not reproduced.Hill sort, is a narrowing incremental sort. It is sorted according to the step size, different steps may produce different sequences, but
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