Use crontab you can perform a specified time in the Shell script or a series of Linux command. For example, the system administrator schedules a backup task to run every dayEntry# crontab–eThis enables the edit mode to open the personal crontab
Use crontab you can perform a specified time in the Shell script or a series of Linux command. For example, the system administrator schedules a backup task to run every dayEntry# crontab–eThis enables the edit mode to open the personal crontab
The following content is basically extracted from the Shell13 question.1. Truncation function${file#*/}: Take out the first/its left string: dir1/dir2/dir3/my.file.txt${file##*/}: Take out the last/and left string: my.file.txt${file#*.}: Take out
Pre-defined variables:Predefined variables are a class of special variables that are predefined by bash programs, and users can only use predefined variables, not create new predefined variables, or assign values directly to predefined variables.
1. Press the TAB key for the command to be padded2, clear or ctrl+l clear screen3, ctrl+u Delete the command before the cursor4. History view executed commands5, the key of the arrow keys can see the executed command1. Command aliasesExample: Alias
Thanks to the original, the article is very helpful.Transferred from: http://www.cnblogs.com/chengmo/archive/2010/10/02/1841355.htmlFirst, Judge read the string value
An expression
meaning
In some cases, such as Oracle, you must switch to the specified user to restart Oracle.Each time the manual operation is more troublesome, you can write a script.The function of automatically entering password, need to use expectInstall firstYum
A gentleman is open-minded and optimistic; A small person is narrow-minded and pessimistic."The gentleman is magnanimous, the villain long Obsession"Reference: Bird Brother's Linux private cuisine Basic Study (third edition)The basis of regular
Cut is a selection command:is to analyze a piece of data and take out what we want. In general, the selection of information is usually for "line" to analyze, not the entire information analysis.(1) The syntax format is:cut [-bn] [file] 或 cut [-c] [
The basic job of the shell is to execute commands.The shell executes each command you type.$CD work;ls-l whizprog.cFirst: The format is simple, separating the various components of the command line with a blank Space key or TAB key.Second, the
1.10 Get, set date and time delay
Many applications need to print the date in different formats, set the date and time, and perform an action based on the date and time. Latency is typically used to provide a wait time (for example, 1
Like other languages, loops are also script patterns in the shellOne. Grammar: while [expression] do operation ... done As long as the expression in [] is set, it will continue to loop.
1. Types of variables in the shellVariables in the shell can be divided into environment variables, positional variables, predefined special variables, and user-defined variables,2. Environment variablesEnvironment variables in the shell are a
Variable Description:$$ The shell itself PID (ProcessID)$! PID of the Shell's last running background process$? End code of last Run command (return value)$-flag at a glance using the SET command$* all parameter lists. such as "$*" in the Case of ""
You can use, let (()) [] perform basic arithmetic operations, and use advanced operations bc more efficiently.Look directly at the code and the output is clear.Let[Zhengweiwu A: -~]$ no1=4[Zhengweiwu A: -~]$ no2=5[Zhengweiwu A: -~]$ Letresult=no1+no2
1. What is bash?Bash is a Unix shell written for the GNU program and is the default shell used by many Linux platforms.The shell is a command interpreter, an insulating layer between the operating system kernel and the user. At the same time, the
Position parameters can be usedshiftcommand to move left. Like whatshift 3Indicates that the original$4Now become$1, the original$5Now become$2Wait, the original.$1、$2、$3Discarded$0Do not move. With no parameters.shiftcommand is equivalent toshift 1。
The shell script is used to add a user to delete a user's deleted files,
#/Bin/bash # DEBUG = 0ADD = 0DEL = 0RM = 0 while [$ #-gt 0] docase $1 in-v |-verbose) DEBUG = 1 shift ;; -h | -- help) # help document echo "'basename $ 0' -- add LIST -- del
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