1. "Current Shell"Commands enclosed in {} are executed in the current shell. there must be whitespace after the opening {, or else you get a syntax error. one more restriction: commands within the {}'s must be terminated with a semicolon when given
Difference between $ * and $ @ in Shell
A little bit about $ * and $ @ is also learned by cainiao.
$ *All location parameters are used as a word.Note: "$ *" must be referenced.$ @It is synonymous with $ *, but each parameter is an independent ""
Mysql1 # Cat mysqlbackup. Sh#! /Usr/local/bin/fish # The backup policy is daily full backup # Setting backup path variables Set backupdir/usr/DB/backup # Generate a backup directory Mkdir-p $ backupdir # Delete a backup that has been backed up for
I recently tested LTP. I felt that there were too few materials on hand. I searched the internet and said that I had to look at the code from the beginning, because I had to look at the links in the past, there are too many test cases, so it is no
VI editing tool usage:
Common commands:
H, J, K, L correspond to the left, bottom, top, right
CTRL + F flip forward
CTRL + B flip back
0: Move to the first character of this line
G moves to the last row of the file.
N [enter] move the cursor down n
Like other programming languages, shell scripts provide if esle, do while, for, case, and so on for program execution streams. Like other programming languages, the existence of the shell script program execution flow is to establish a complete
1 Have you ever wondered why SED is called sed?
Sed is short for stream editor. Sed is a stream editor. To put it bluntly, we enter a string of information into SED, which is processed and output. That's simple.
Similar to cut, sed is a row-oriented
When I went to bed in chemistry today (Khan ......) dreaming, dreaming of penetrating a magic = off PHP injection point, and then happy mouth water flow (..... sleep too much), suddenly woke up, and immediately wrote the dream idea on the paper:
Mycommand> mylog.txt 2> & 1 should be the most classic usage.
Command results can be output in the form of "%>", % indicates the file descriptor: 1 indicates the standard output stdout, and 2 indicates the standard error stderr. The default value of
In Shell, only one process can be implemented at a time:
1. lockf command
2. Simple implementation:
I = 'ps-Ef | grep [N] ew_mvbackup | WC-l' if [$ I-GT 1];ThenEcho "wait for the other mvbackup finish! "Exit-1Else
# Do something here
3.
Hadoop shell command remote submission
I. Principle of hadoop shell command remote submissionHadoop shell command execution is usually performed through Linux Shell in many scenarios. It is also very painful for developers who are used to remote
Conditional statement if-then Structure
If [condition]ThenCommandsFi
Note: To put then and if in the same row, you need to write the following:If [condition]; thenIn shell.
In addition,There must be a space between [] and condition !!!For more
Get the current period: 'date + % Y % m % d', 'date + % F', or $ (date + % Y % m % d)Get the period of yesterday: 'date-d Yesterday + % Y % m % d'Get date of the day before yesterday: 'date-D-2day + % Y % m % d'And so on, for example, get the date 10
Variable configuration rules
The variable and the variable content are linked with an equal sign "=", as shown below:"Myname = vbird 』
The equal sign cannot be directly followed by a space character, as shown below:"Myname = vbird" or "myname
How to extract the line Content Code specified by the file:
If you only want to view the first five lines of the file, you can use the head command,For example: Head-5/etc/passwd
If you want to view the last 10 lines of the file, you can use the
Reprinted statement: This blog article allow free reprint, but reprint need to indicate the author, source: Denny wqf363@hotmail.com Source: www.huntmine.com
Shell-specific variablesTable 14-2 specific s h e l variable $ # number of parameters
How to Learn shell commands in Linux
I learned some of the scattered linux commands today. The following is a summary:
First of all, when you don't know how to execute commands, of course we need man. Let this man save everyone! Haha!
Common network
This morning, I finally got rid of the last question D. My second point is an AK.I still have the copyright to answer this question ~~ More and more interesting!Let's talk about how to do it.I heard that I tried to push the formula myself. It feels
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