Rsync starts closing shell scripts

This script can be placed in the/etc/init.d/directory with service RSYNCD Start\stop\status\restart management, you can also use Chkconfig for boot-start management, detailed script content as follows:#!/bin/bash# ************************************

Shell finishing (37) = = = Variable understanding and two exercises

1/etc/profile2 ~/.bash_profile3 ~/.BASHRC4 $PATHWhere/etc/profile is the global environment variable that takes effect for all users, while. Bash_profile only works on the current user.~/.bash_profile: Each user can use this file to enter shell

Linux bash Shell determines whether a directory is empty

#!/bin/sh# #方法一 Determine the number of output characters counted as 0is_empty_dir ( ) {return ' ls-a $1|WC-w '}# #方法二 Determine output string is empty #is_empty_dir () {# return $[-Z ' ls-a $1']#}if is_empty_dir $1 then' is empty'else

[Turn]bash shell common shortcut keys

Tag: will return CTR Word delete Move page ackMove cursor ctrl+b: Move forward one character (backward) ctrl+f: Move back one character (forward) alt+b: Move forward one word alt+f: Move back one word ctrl+a: Move to the

Nginx Log cutting shell by day

#!/bin/bash############################################## #Author: Liuzhengwei-[email protected] #QQ: 1135960569# Last modified:2017-08-16 16:05#filename:nginx_logrotate.sh#description:######################################### # # # # #back_dir

"Gadget" shell detects process status exception auto restart

The shell script is an operation of the basic skills of personnel, in peacetime work, in order to deal with some anomalies or query data, I often have to write shell scripts automated processing.Here to share a script I wrote to detect the status of

Common commands for the shell

SortHandle sorting problems.For example: Sort-r/file the rows of file in descending order.Tr:As a simplified version of SED, you can replace another character with one character, or delete some characters.CutSplitting according to the line of the

Linux Shell Usage Notes

1. BackgroundThe Linux shell is a basic skill, because the weird syntax, combined with poor readability, is often replaced by scripts such as Python.Since it is the basic skills, it needs to be mastered. After all, the process of learning shell

Shell CPU Utilization Memory utilization

#!/bin/bashcpu_usage_idle= ' Top-b-N 1 | grep Cpu | awk ' {print $} ' | Cut-f 1-d "." ' Let cpu_usage=100-$cpu _usage_idlemem_total= ' awk '/memtotal/{total=$2}/memfree/{free=$2}end{print (total-free)/ 1024x768} '/proc/meminfo ' mem_usage= ' echo

The most basic syntax for bash shell

1 Basic composition of shell statementsThe shell is separated by a space between each basic constituent element.For example, [-E file],[,-E, file,] these four basic elements are separated by a space.Same reason [!-e file],[,! ,-E, file,] each of

Shell command Tips--text to weight and maintain the original order

In short, this technique corresponds to a scenario such as the followingAssume that there is text such as the followingccccaaaabbbbddddbbbbccccaaaaIt needs to be re-processed now. This is very easy,sort-u, but suppose I want to keep the text in its

Post a shell for reference

1#! /bin/Bash2deploy_path=$ (CD"$ (dirname"$0")";pwd)3ini_file= $DEPLOY _path'/cnedmp_etl.ini'4 . $INI _file5base_path=$ (CD"$ (dirname"$DEPLOY _path")";pwd)6main_path=$ (CD"$ (dirname"$BASE _path")";pwd)7Currrent_date= 'Date-U +\%y\%m\%d

Introduction to Linux Shell

What is a Linux Shell A shell is a user program, or an environment that is provided for the user to interact with the system.It is a language interpreter that executes commands that are read from a standard input device, has its own built-in shell

HDU Shell Necklace CDQ Division +fft

Shell Necklaceproblem DescriptionPerhaps the sea ' s definition of a shell is the pearl. However, in my view, a shell necklace with n beautiful shells contains the most sincere feeling for my best lover Arrietty , but even that's not enough.Suppose

Linux Shell Basic Specification

Start specifying the script interpreter# !/bin/bash or #!/bin/sh Opening plus copyright information#Date: 2017-8-01 22:50#author:yang Qiang wei #Mail: [email protected] #Funtion: This is delete ... #version: 1.0 No Chinese comments in

Shell scripting monitors memory and sends messages

1. Prepare the tool to send the message:#!/usr/bin/python#-*-Coding:utf-8-*-Import SysImport SmtplibImport Email.mime.multipartImport Email.mime.textServer = ' smtp.163.com 'Port = ' 25 ' def sendmail (server,port,user,pwd,msg): SMTP = Smtplib.

Linux command Detailed (10) An array of shell scripts

1. Array definition[[email protected] ~]# a= (12345678) [ [Email protected] -IDC ~]# Echo $aA pair of parentheses indicates an array, and the elements of the array are separated by a "space" symbol.2. Array reading and Assignment1) Get the length

Java invoke shell script

There are several places in the recent new project where you need to invoke the shell script, which records a simple shell script invocation method. The code is as follows:private void Callsh () {InputStreamReader STDISR = null;InputStreamReader

[Shell programming] Shell multithreaded operation instance

1. Demandfind all unused IPs in a 192.168.0.* network segment2. Realize We know that finding methods that do not use IP can be done using the ping command. For a single IP judgment, use the following command$Ping-C1 192.168.0.1PING192.168.0.1(192.168

Python3 determine if the process exists in the shell && start && Email notifications

Determine if the process existsdefisrunning (process_name):Try: Process= Len (Os.popen ('PS aux | grep "'+ Process_name +'" | Grep-v grep'). ReadLines ())ifProcess >= 1: returnTrueElse: returnFalseexcept: Print("Check

Total Pages: 541 1 .... 343 344 345 346 347 .... 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.