The following script backs up all the source files to be edited into the/bak directory, and all path locations remain unchanged, such as Vii/etc/hosts, and the/etc/hosts is copied to/bak/etc/hosts.
# CAT/SH/VII
#!/usr/bin/bash
#判断源文件是否存在, exist
This article mainly introduces 4 methods of executing the shell script and the difference introduction, this article explained the relative path way, the absolute path way, the Bash command call, the relative or the absolute way as well as the next
Shell Script
Just do it, simply write a Shell script and it's done!
Script Name: Web site dead chain generation script
Script function: Daily analysis of the site the day before the Nginx log, and then extract the status code of 404 and UA for
In the hint: many of the translation of Ubuntu is literal literal translation, there are many problems, so I suggest you refer to my explanation here. Of course, it was also some of the suspicion of the text, I hope.
Often operate on Linux, have a
HBase is the Open-source implementation of Google BigTable, using Hadoop HDFs as its file storage system, using Hadoop MapReduce to handle the massive data in HBase, using zookeeper as a collaborative service.
1. Introduction
HBase is a
Remove software
To remove the software is very simple, just execute the following command:
Copy Code code as follows:
# rpm–e Xanim
At this point, the user should be careful to use the name of the software Xanim, rather
Previously used Ubuntu, the installation of uninstall software is basically using apt-get this very simple, and the process of software dependencies will automatically help us deal with, similar to the fool-like installation. In addition, in the
In Linux if planning time is a hassle,
Use the awk script as follows
BEGIN {fs= ":"; ofs= ":"}
{total_seconds=total_seconds+$3}
total_seconds>=60 {Total_seconds=total_ sconds-60
$2=$2+1
}
{total_minutes=total_minutes+$2
$2=$2+1
The Ubuntu default does not have SSH service installed, which can be done with the following command:
Copy Code code as follows:
yblin@yblin-desktop:~$ ssh localhost
Ssh:connect to host localhost Port 22:connection refused
There are several ways to execute a shell script
1, relative path mode, need to first CD to script path
Copy Code code as follows:
[Root@banking tmp]# Cd/tmp
[Root@banking tmp]#./ceshi.sh
Script execution succeeded
2.
This is a shell script, so first you need to install a basic Cygwin environment and, of course, curl.
The principle is very simple, first download the latest MIRRORS.LST mirror list from cygwin.com, after simple processing, using curl to detect the
In bash, Bash's math is a little awkward, it's hard to adapt and remember, so you have to write a blog post to make it easier to look through. There are four ways to perform mathematical operations:
A, let order
Copy Code code as follows:
BASH shell set font and background color
Echo-e "\e[31mtest\e[41m"
\e[30m change the display color of a character to black
\e[31m change the display color of a character to red
\e[32m change the display color of a character to green
\e[33m change
Many people use shell scripts to accomplish simple tasks and become part of their lives. Unfortunately, shell scripts can have a very large impact when they run an exception. It is necessary to minimize this type of problem when writing scripts. In
Need to use shell script every 3 seconds to monitor the running state of a software process, found that Crond seems to only support to the points, do not know seconds, how to do?
The first method:
Of course the first thought is to write a trigger
Especially in today's various browsers are flying (it is said that only IE is the kernel of the browser there are 200 kinds of).
Little brother today wrote a jquery based plug-in extension that identifies the type and version of the browser's kernel
The shell monitors the site for unusual script, such as an abnormal automatic email notification to the administrator.
Process:
1. Check that the Http_code returned by the Web site is equal to 200, if not 200 as an exception.
2. Check Web site
In this article I introduce a few very useful and network-related commands
I. Ifconfig
This command is "translated to ipconfig" under windows and is used to display details such as network interfaces, subnet masks, and so on.
Note: In each system,
#!/bin/bash#author:yanconggod#date:2017-01-19#version:1.0# using uptime command to monitor system load postfix_path= "/usr /sbin/postfix "mailx_path="/usr/bin/mailx "email=" [email protected] "# get native IP address ip= ' IFCONFIGENP2S0 |grep '
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