Absrtact: In the process of learning, inevitably encounter some commands, the kind of need, but you do not have command. In order to save time, worry about forgetting these, special Open this essay, at any time to record some of the commands used.
0 indicates standard input1 indicates standard output2 indicates standard error output> default to standard output redirect, same as 1>2>&1 means redirecting the standard error output to the standard output.&>file means to redirect both the standard
Linux class Assignment Wednesday, if there is a poor consideration to the place, also please advise.Shell Processing Text See this blog for common commands related to##如果输入两个参数 is the first to count the number of words, the second is the article to
The while loop is applicable to scenarios where the number of loops is unknown.Syntax format: While conditiondo statement ...... Done Note: While is used to execute a loop when the condition is set up. When the condition is invalid, the loop is
The custom shell in Ubuntu generally includes the Host Name and file directory. when too many files are opened, the whole shell will become very long, thus affecting the vision.
Enter $ echo $ SP1 in the terminal to know the default shell style, for
Traditional if statements -- use conditional expressions as if conditionsIf [conditional expression]ThenCommandCommandCommandElseCommandCommandFiConditional expressionsFile expressionIf [-F file] If the file existsIf [-d...] If the directory
In shell programming, some string variables are often processed. For example, commands such as awk, expr, sed, and TR are often used to calculate length, intercept substring, and replace character. Next we will introduce a simple string processing
After a netizen watched the old boy's shell video today, he asked the following question:
650) This. width = 650; "Title =" snap17.jpg "alt =" wkiol1oz8i_gwllfaaetvavr46c745.jpg "src ="
Copy codeThe Code is as follows :#! /Bin/sh
# Obtain the date interval from the first day of the quarter to yesterday
# Link: www.jb51.net
# Date: 2013/2/28
Day = 'date-d "1 days ago" "+ % Y % m % d "';Year = 'expr substr $ {day} 1 4 ';Month =
1. define the shell function (define function)
Syntax:[Function] funname [()]{Action;[Return int;]}Note:1. It can be defined with function fun () or fun () without any parameters.2. If the parameter is returned, the value "+: return" is displayed.
Environment: 2 kserver + iis5 succeeded. The default permission is iusr.
Iis permission: script executable Description: by default, the server. createobject method can be used to use installed components on 2 k servers.
For example, we all know
1. Example of an error method
A)
Var = 1 + 1
Echo $ var
The output result is 1 + 1. Tragedy.
B)Var = 1Var = $ var + 1Echo $ varThe output result is 1 + 1, which is still tragic.
2. Correct Method1) Use letVar = 1Let "var + = 1"Echo $ varThe output
Assume that the same Command needs to be executed on multiple nodes (considering the uncertainty of the command). Generally, the for loop is used and the command can be directly called through ssh. For example, you need to view the root directory
Very powerful shell to write Russian square, shell Russian square
On the Internet, you can see a Russian box written using linux shell scripts. It is the most awesome shell I have ever written. Share.
The original author information is included in
1: grep command:
Grep-v "char" file_name match text that does not contain "char"
Grep-n-w "char" file_name completely matches a character
Grep ^ s $ s is the text that matches the first or last row of s.
2: tr command
Tr set1 set2 replace set
Sometimes you need to configure a static IP address for the server or something and you do not know that the IP address is not occupied. In this case, it is very convenient to use this script.# Cat arping#! /Bin/bashIPaddr = 192.168.0.IPFILE
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