Shell script Backup Database (docu)

bz2

#!/bin/bashPath=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbinExport PATH#数据库用户名Dbuser= ' Root '#数据库用密码dbpasswd= ' Password '#需要备份的数据库, multiple databases are separated by spacesDbname= (' dbname1 ' dbname2 ' dbname3 ' dbname4 ' dbname5

Shell Common Command Summary (iii)

1.1. usage of the Cut command in the shellThe first usage is similar to awk, as shown in awk below :Cat/etc/passwd|awk-f: ' {print $1,$5} 'Cut-d: The colon after-F 1,5/etc/passwd/-d indicates the delimiter between the fields, and-f indicates which

Knowledge and usage of shell in Linux

The shell script, as its name implies, is a script written for the shell, as long as there is a text editor and an interpreter that can execute the script.There are many types of Shell in Linux, we can open a text editor (can use the Vi/vim command

MAC Shell Notes

Used to automate some of the front-end publishing operations.Script:# Webreleasepath is used to publish the directory, Webrevisionpath is the development of the directory

Linux Learning (22) Shell Foundation (ii) Variable, environment variable profile

One, variableA variable is a container in which different values can be placed.Key facts:Path,home,pwd,logname these are variables.Example:[[email protected] ~]# echo +ba+~]# echo $a +$b3+4~~ ]# echo $a 3$b4~]# echo $a"3"$b334 The summation of

Shell Exercises-judging functions

Use the conditional function if to compose a shell function called F_judge, which implements the following functions1) when the/home/log directory exists, move the files or directories that start with all TMP in the/home directory to the/home/log

Linux--Shell programming

Linux--Shell programming one, regular expression 1, regular expression PK wildcard        2.Basic Regular Expressions1),*The previous character matches 0 or more times~ grep "A *" Test_rule.txt # matches all content, including blank lines~ grep "aa*"

Shell-neutral expression primitive characters

^ matches only the beginning of the line$ matches end of line only* A single character immediately after the *, matching 0 or more of this single characters, it can also be a sequence. You can use-to represent a range of character sequences within []

Shell Simple Summary--grammar

First, condition testThe command test or [can test whether a condition is true, if the test result is real, the exit status of the command is 0, if the test result is false, the exit status of the command is 1 (note the exact opposite of the logical

Shell finds files within a specified time period

#!/bin/bash#20170905 input parameter formatecho "displays" Backup Files "Date_0=$1date_1= ' expr $date _0 + 1 'date_2= ' expr $date _0 + 2 '#定义时间段touch-d $date _0/tmp/tm-0.file #开始时间touch-d $date _1/tmp/tm-1.file #结束时间1touch-d $date _2/tmp/tm-2.file

Shell file permissions and script execution

ll command to view file informationThe first root represents the creator of the file, and the 2nd root represents the group root that the file belongs toRWX delegate Rights R (read) permission, W (write) write permission, x Execute permission,

Shell: Delete/Preserve a specified line in a file

Delete the first line in the file file1 to the line containing word characters and redirect to the file File2:Sed ' 1,/word/d ' file1 > File2Keep the lines in the file file1 that contain word characters and redirect to the file File2,-n to indicate

First shell Script--Modify configuration file

There is demand, can let oneself lazy is the real motive force of study. Because the test environment always needs to manually modify the configuration file after building the code, the learning side completes a shell script that can be modified

Shell Common Commands

1. View Memory usageFree-m2. View drive Information usageFdisk-l3. View CPU and Memory usageTop4. View CPU Information commandsCat/proc/cpuinfo5. View memory InformationCat/proc/meminfo6. Modify the IP

Shell Miscellaneous Set

1, Shell Equality comparison note-eq Comparison of numbers equal= = Comparison of string equality2, = = and the difference= = can be used to determine if a variable is equal, = In addition to being used to determine whether a variable is equal, it

Bulk Delete User--shell script

#!/bin/bash# #User  : mobanche#date : 2017-7-17#work : delete user########### ####################################          define  function         ############################################### function get_answer {#unset  ANSWERASK_COUNT=0#while 

The difference between $* and $@ in the shell

$* all positional parameters, being used as a wordNote: "$*" must be referenced by ""[email protected] is synonymous with $*, but each parameter is a separate "" reference string, which means that the parameters are passed completely, are not

Shell parameter processing templates

Save a copy of the template, then use it for simple parameter processing#!/bin/Bash whilegetopts h:ms option #选项后面的冒号表示该选项需要参数 Do Case "$option" inchh)Echo "option:h, Value $OPTARG"#参数存在 the $optargEcho "Next arg index: $OPTIND";; m)Echo "option:

Numerical conversion in the shell

Octal (020) →10[[email protected] yemo]# echo $ ((num=020)) 16[[email protected] yemo]# echo $ ((num=8#20)) 16Hex (0xff) →10[[email protected] yemo]# echo $ ((NUM=0XFF)) 255[[email protected] yemo]# echo $ ((NUM=16#FF)) 255[[email protected] yemo]#

Lua invokes shell script

In Lua, Os.execute can execute DOS commands, but returns the system status code, which is the default output.Io.popen () can also execute DOS commands, but returns a file. egCopy the Code code as follows:Local T = Io.popen (' svn help ')Local A =

Total Pages: 541 1 .... 488 489 490 491 492 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.