SQL statement writes shell with log

OutFile is forbidden, or written files are intercepted;Operations in the database are as follows: (must be root permission)Show variables like '%general% '; # View Configuration Global general_log = on; # turn on general log mode Global

Shell Learning (iii)

Libvirt Tools for managing the KVM itselfVirt-install installation packages for installing virtual machines, installing virtual machinesVirt-mananger: Managing a tool to create a delete virtual machine---restore content starts---1 Grep-e "SVM | VMX "

Custom functions in the shell

Customizing a function for printing function parameters[[email protected] shell]# vim fun1.sh#!/bin/bashpri(){ echo "第一个参数为 $1" echo "第二个参数为 $2" echo "文件名为 $0" echo "总共有$#个参数" }pri a b #调用函数Execution

Shell Learning variables and quotes

1. The concept of variables: variables are stored in the program of the user's memory space, the variable name is the address of this memory space, the value of the variable is stored in the computer memory. Variable definition: It is simple to

Shell Programming--for Loops

Script[[email protected] shell]# vim for1.sh#!/bin/bashfor i in `seq 1 6`do echo $idoneExecution results[[email protected] shell]# sh for1.sh123456Script[[email protected] shell]# vim for2.sh#!/bin/bashsum=0for i in `seq 1 6`do echo "$sum

Shell Script Basics (iii)

One, for loopThe For loop structure is a very frequent loop structure used in daily operation and maintenance work.1. For loop specific format:for 变量名 in 循环条件; do commanddoneThe "loop condition" here can be a set of strings with numbers

10 Common shell scripts for combat and interview--1

# # #10个实战及面试常用的shell脚本 Some considerations before writing the script 1. Start with interpreter: #!/bin/bash pre> 2. Syntax indentation, using 4 spaces, more attention to the description 3. Naming rules:

Bash Shell concludes "three"

Cat Head Tail grep Sed awk Cut WC Sort Uniq TR TAC Rev Cat, Concatinate, connects the contents of one or more files sequentially, outputting them to the standard output.Cat 12.pub Cat-n 12.pub Cat-a file # Merging filesCat 12.pub 13.pub 14.pub

Shell Test condition judgment

Test condition judgment# symbol [] equals test commandTen 5 # Judging the size of echo $? # View the previous sentence The test command returns the status "hello" # To determine if the string length is 0[$ 0"success" | |

MUTT+MSMTP implementing e-mail in a shell environment

In order to automate the receipt of file backup information from the server, the MUTT+MSMTP is used to send e-mail in the shell environment, which is an easy and efficient way to complete operations.Download MSMTPwget

Shell Script Programming Learning notes-functions

1. Why use a functionLook at the role of aliases first[[email protected] ~]# alias httpd=‘/etc/init.d/httpd‘[[email protected] ~]# httpd start正在启动 httpd: [确定]function is to call the program multiple times the same code part is defined as a copy

Hbase-shell Study 1

CREATE table zn_post, column family CF1create ‘zn_post‘, ‘cf1‘ List existing tableslist Number of query recordscount ‘zn_post‘ Inserting recordsput ‘zn_post‘, ‘20180122-10000001‘, ‘cf1:name‘, ‘niewj‘ put ‘zn_post‘, ‘20180122-10000002‘, ‘cf1:

The second week of Linux learning; shell programming

Pstree-p #显示进程编号 (tree) echo $$ basic structure of #显示当前shell进程编号   scripts: #! Shebang (indicates what shell is used to open a file, typically using bash) configuration_variables #定义变量FUNCTION_DEFINITIONS # define function Main_code #主要执行命令  

The use of if,case,for in shell scripts

DirectoryI. Condition selection: If statementTwo. Conditional judgment: Case statementThree. For loopI. Condition selection: If statement Single Branchif judgment condition; thenBranch code with true conditionFiExample: Judging whether a number

Linux Shell daemon/RAC Restart script

To establish a daemon process:#! /bin/sh PRO_NAME=./xxxx.sh while true ; do #用ps获取$PRO_NAME进程数量 echo ‘‘> nohup.out NUM=`ps aux | grep -w ${PRO_NAME} | grep -v grep |wc -l` #echo $NUM #少于1,重启进程 if [ "${NUM}" -lt "1"

Shell script Programming Shell string

1. Limitations of single-quote strings: Any character in a single quotation mark is output as is, and the variable in the single-quote string is not valid; Single quotation marks cannot appear in single quote strings (not after using escape

Automatically log on to the server shell script

#!/bin/bash#Description: Auto Login The remote server#Author: Majinxu#Version: 1.0#CreateTime: 2018-3-012 18:34:41User= "Majinxu"Passwd= "! Ieric1234 "host_list= ("st1.qa.bj2.yongche.com""St2.qa.bj2.yongche.com""St3.qa.bj2.yongche.com")#seletc the

Linux Learning Notes (25) Shell special symbols, Sort_wc_uniq, tee_tr_split

one, special characters 1.Any character of ' * '‘? ' Any one character' # ' comment characters' \ ' de-semantic characters' | ' Pipe characterMost of them have been used before, for the caret ' \ 'Examples of the use of the caret2. Several

Using the shell to do the Nginx log analysis

#!/bin/bashif [[$# = = 0]];thenecho "Error: Please enter the number of days to query???"Elseecho "Temporarily does not support the 7 version of CentOS!!! "now_time_cuo=date +%s((end_time_cuo=${now_time_cuo}- echo $1*3600*24 | bc ))Now_time=date |

Shell exercises (eight)

Exercise 1: Monitoring disk usageRequirements: Write a shell script that detects all disk partition usage and inode usage and logs to a log file named after today's date, and notifies you when a partition capacity is found or the Inode usage is

Total Pages: 541 1 .... 403 404 405 406 407 .... 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.