Use the shell to monitor if the files under the site Directory have been modified

#!/bin/bash#check_file_md5 find/application/nginx/html/test1/-type F | Xargs md5sum >/tmp/web_md5_f.txt#check_file_num tree-i/application/nginx/html/test1 | Grep-v "^$" >>/tmp/web_md5_num.txt.defaultmd5= '/usr/bin/md5sum-c/tmp/web_md5_f.txt | Grep-v

Shell---------Debug Mode

If you have been exposed to the C language, you should know that the C statement is executed when the error editor will indicate the specific error in that line, of course, these errors are the machine can not be executed error! Unfortunately our

Shell determines disk space delete file

#!/bin/bash# @loyu################################################################################Sum= ' Df-h | awk ' {print $} ' | Sed-n 4p | awk-f% ' {print '} 'If [$sum-GT 75]ThenDate= ' Date +%y%m%d 'Echo-e "\NPDT"Echo

Shell to determine if a variable is empty

Determines whether a variable is empty.1. The variable is caused by "" quotation marksAs shown below:, you can get the result is NULL.#!/bin/shpara1=if [!-n "$para 1"]; Thenecho "is NULL"Elseecho "Not NULL"Fi2. Judging directly by variablesThe

Shell Common Commands

LS-LH //view file sizeLS-LH filename //View the actual size of a filedu-h //Viewing the size of a file as a diskdu-h filename //View the size of a fileThat LS looks at the actual size of the file, Du is looking at the size of the disk blockDu

Linux Shell 01 Scripts and variables

Creation and execution of a script1. Create file *.sh, file suffix sh2. Editing scriptsThe first line must be: #!/bin/bash #指定解释脚本的shell3. Empoweringchmod u+x a.sh4. Implementation./a.shVariables in the two shell scripts1. Definition and deletion of

Talk about the background process and foreground process of shell in Linux

Environment:Operating system: ArchLinux; Terminal Simulator: Rxvt-unicode (URXVT); Shell:bash;The background process referred to here is a ampersand (&) behind the command line, and the foreground process is the form of a command line that does not

Shell Exercise 1

Write a script: The requirements are as follows:1: Say hello to each user in the/etc/passwd directory, and indicate its UID number! (Eg:hello Root,your uid is 0)2: How many accounts does this script share?#!/bin/bashName= ' cat/etc/passwd |awk-f: ' {

Shell installation Tomcat (three)

#!/bin/bash#bu lctomcatdir=/home/tomcattomcattar= $TOMCATDIR/apache-tomcat-7.0.65.tar.gzjavadir=/usr/ javajdkdir= $JAVADIR/jdk1.8.0_65jdktar= $JDKDIR/jdk-8u65-linux-x64.tar.gz### #8080 # # # # #T8080DIR = $TOMCATDIR/ tomcat-reststart8080= $T 8080dir/

Building Shell Basic Scripts

Create a simple shell script filePlacing the shell command in a text file requires first using a text editor (VIM)When you create a shell script file, you must specify the shell (#!/bin/bash) to be used in the first line of the fileThe format is:    

Shell script implementation to read the configuration file

(I am participating in the 2015 blog Star Selection, invite you to vote, thank you: HTTP://VOTE.BLOG.CSDN.NET/BLOGSTAR2015/CANDIDATE?USERNAME=ZHOUZXI)Recently, in the process of development work, a requirement was encountered: A shell script was

Shell Small Example

Requirements: This directory is currently created if the result directory does not exist. If Socwatchoutput.csv is present, move it to the result directory Then, pass the parameter kpi_name, #!/bin/sh#Used to save CSV file#write it by

Linux Shell Special variables

$: script name, which is the script name entered by the command line$n: Positional parameters, n>0, when n>9, using ${n} form$#: Number of positional parameters"$*": All Positional parameters (single string)[Email protected]: All positional

Shell Common Scripts

Objective Online collection, thank the old boy and the big God, often read their blog and video, script is absolutely their own pure hand, what shortcomings, but also please the Great God guidance. If you feel that there is a violation of the

Shell Programming--eof (reprint) that requires interaction

In shell programming, "EOF" is usually used in conjunction with "Return to the keynote shell again, which can be interpreted as a delimiter (delimiter). Since it is a delimiter, the form is naturally not fixed, where "EOF" can beCustom, but the

Shell Script Implementation command line multilevel menu (no specific function)

#!/bin/bash#auth chentp0601#date 20151123Function menu (){ClearCat #this is Base menu1.[install Lamp]2.[install LNMP]3.[exit]EofRead-p "Please input 1-3:" ListCase $list in"1")While TrueDoMenu_lampDone;;"2")While TrueDoMenu_lnmpDone;;"3")Echo-e

Lao Li share: "Linux shell Script Raiders" Essentials (VI)

1. Print network interface list [[email protected] touch_more]# Ifconfig | cut-c-10 | Tr-d ' | Tr-s ' \ n 'Eth0lo//cut-c-10;      Outputs the first 10 characters;//tr-d ";     Remove all spaces;//tr-s ' \ n '; Compress duplicate newline characters 2,

Shell Statistics Log Information

Shell Statistics Log InformationIn general applications, log information is logged using log4j and a log file is generated daily, with each file ending on the date of the day.How do I count and analyze these log messages?In the simplest cases, use

Shell Programming Examples

organized a few shell programming examples, for beginners! 1. InThe home directory creates 100 directories and the directory name is a1......a100. Instance 1 for((i=1; i -; i++)) Do mkdir "/home/a"$i DoneExample 2, you can also write a bit more

Shell Primer-awk-1

The advantage of awk for sed grep is segmentation, dividing the delimiter into a small segment, matching, replacing, manipulating, logical judging, comparing ... such asBasic operations of AWK[[email protected] ~]# awk-f ': ' {print $} ' 1.txt////-F

Total Pages: 541 1 .... 494 495 496 497 498 .... 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.