Last time I wrote the shell, I found that VI and VIM are different: Vim is the upgrade version of VI, it is not only compatible with all VI directives, but also some new features in it. Vim is much more useful than VI.This time the last content, the
[This is my own study notes, welcome reprint, but please specify the source:http://blog.csdn.net/jesson20121020]
Start learning some shell flow control structures like other high-level languages today
Flow control Statements:1. If
Character expansion*This "*" character means matching any character in the file nameThe shell expands "*" into something else, before the echo command is executed.~ Home DirectoryArithmetic expression expansionAn arithmetic expression expands using
Shell floating point arithmetic tool BCBC supports floating-point numbers, which is an advanced tool for mathematical operations.[[Email protected] Desktop]# BCBC 1.06Copyright 1991-1994, 1997, 1998, Free Software Foundation, Inc.This is the free
String-related operations are often involved in the shell batch process. There are a lot of command statements, such as: awk,sed can do string various operations. In fact, the shell built a series of operating symbols, you can achieve similar
1. Open the terminal and enter the help command to see a list of the built-in shell commands for the system's default shell (usually bash):[[Email protected] ~]$ help GNU bash, version4.1.2(1)-release (x86_64-redhat-linux-GNU) These shell commands
The Shell history record audit and monitoringHttp://netkiller.github.io/journal/shell.history.html Mr.Neo Chen(Chen Jingfeng),Netkiller, Bg7nyt China Guangdong province Shenzhen Khe Sanh Street, Longhua District, civil Administration518131+86 1311366
PS | grep $$ | awk ' {print $4} 'PS command without parameters displays the status of the process associated with the current terminal$$ variable stores the PID of the current processPS Fourth column is the command used by the process, if it is a
System Integrity Audit ToolThe shell script is as follows:The #!/bin/bash## variable is first declared to use shopt -s -o nounset# declaration # build Date date=$ (date + '%Y%m%d%H %m%s ') # join the approved directory #Dirs =
With Jenkins, you know, there's an add buld step in the build configuration, with two options:1. Execute Windows Batch Command2. Execute ShellThe 1th one is to execute the Windows command, and the 2nd is to execute the shell script.At first I
Case ... Esac is similar to the switch ... case statement in other languages, and is a multi-branch selection structure.The case statement matches a value or a pattern, and if the match succeeds, the matching command is executed. The case statement
After adding some interceptor code, the CPU alarm shows that CPU utilization exceeds 100%.To find out exactly what code consumes too much resources, find a blog post from the Web, reproduced as follows:http://blog.csdn.net/guixunlong/article/details/
Suppose we define a variable: file =/dir1/dir2/dir3/my.file.txt
You can replace $ {} with different values: $ {file # */}: Delete the first/and its left string: dir1/dir2/dir3/my.file.txt $ {file # */}: Delete the last/and its left string:
#! /bin/bash################################################################################# Zabbix extensions (C) 2011-* Joseph Bueno # Published under GNU General Public License version 2 or later.# See LICENSE.txt#--------------------------------
1. FTP automatically logs in to batch download files.##### From/home/data on the FTP server to the local/home/databackup #####! /Bin/bashFTP-n Open 192.168.1.171User guest 123456.BinaryCD/home/DataLCD/home/databackupPromptMget *CloseBye!2. FTP
By default, bash shell is a non-typed footfall language. Unless specifically declared with declare, it does not distinguish whether a variable is an integer variable, a floating point variable, or a string variable. All variables in bash shell are
Linux Shell Parameter extension (Parameter Expansion), parameterexpansion
The main reference: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02
Other materials:
Use an automated shell script to find detailed thread information for CPU usage
After some interceptor code is added to the project, the CPU alarm shows that the CPU usage exceeds 100%;
If you want to find out which code consumes too much resources,
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.