Sometimes I want to find an IP in my home to test the virtual machine. But do not remember those IP is in use, those who do not use (don't say you remember, OK, I admit I am old), so wrote a shell script to detect, easy to use. Script content:
#
Installation use
This script is suitable for most bash environments and has been tested in environments such as CYGWIN,UBUNTU14.04,DEBIAN,CENTOS6,MAC-OSX.
1. Dependency
Before using this program, make sure your Linux or Cygwin supports the
Lattice, as follows:
The code is as follows
Copy Code
[root@myvps1697 201407]# netstat-ntpl|grep sshd|grep-v grep |awk-f: ' {print $} '
In order to solve the problem of space, the 3 of my group have asked all
The most common source package downloaded from the network is. tar.gz package, and part of the. tar.bz2 Package
To decompress is simple:
. tar.gz Format Decompression command for TAR-ZXVPF xx.tar.gz. tar.bz2 Format Decompression command for
Submit Process Related
View file changes and new files
Add new File
git add Your_file_path
//Add all Files
git add *
//Add a type of file
Simple submission of files
Submit all of your modified files and
1 detect the number and status of links to the Web server:
Netstat-ant|awk ' {print $ \ t ' $} ' |grep:: FFFF: ' |sed-e ' s/::ffff://'-e ' s/:[0-9]*//' |sort|uniq-c| Sort-rn|head-10
Results:122 125.162.71.199 time_wait79.119.125.43
Given A number, shows it in comma-separated form. expects DD and TD to is instantiated. Instantiates Nicenum. Or, if a second arg is specified, the output was echoed to stdout.
Nonsense not much to say that the first is
#!/bin/sh #
The hosts one-click Deployment Script under Linux Environment, @lstoars contribution; @fluviusmagnus provides an enhanced version.
Official website: https://github.com/racaljk/hosts/tree/master/hosts_tools
#!/bin/sh # # Script_tool_for_linux #
Script content: java_check.sh
#! /bin/bash
#
If [-Z ' pidof java ']; then
echo-e ' date +%y-%m-%d ' ' Date +%r '. "33[31m33[1m (JAVA) Process does not exist! 33[0m ">>/data/logs/java_check.log
/usr/local/tomcat/bin/startup.sh
In recent time, when dealing with shell scripts, encountered time processing problems. The addition and subtraction of time, as well as the calculation of timing.
I. Time Plus and minus
The way to do this is to turn the base time into a timestamp,
In the previous blog, once wrote the implementation of automated test procedures, now developers need to know the process of being tested (this refers to the main process running on Linux) before the abnormal exit of the process state, such as
Copy Code code as follows:
#!/bin/bash
ping= ' which ping '
Date= ' Date +%y%m%d%h%m '
Tail= ' which TAIL '
Log=./ping$date.log
hosts= "selboo.com.cn 221.130.191.97"
count=200
For MyHost in $HOSTS
Todo
count=$ (ping-c
3.1 Find textgrep: Use POSIX-defined basic regular Expressions (BRE).Egrep: Using an extended regular expression (ERE).Fgrep: Fast grep. Use the optimized algorithm to match a fixed string rather than a regular expression.
The 1992 POSIX standard
First, add suffix
1. Problem: The same directory has a large amount of date-named files, some of which have suffixes, some end with the point, such as 20020101.,20020102.,......,20020101.td,20020102.td ...Requirements: Add all the suffix to the end
In Linux, the/proc/$PID/status file provides the usage of the process resources (memory, stack, semaphore, child parent process), although Linux provides a lot of commands to view memory, but it's all about the overall usage and cannot view the
Copy Code code as follows:
#!/bin/bash
#********************************#
#并发后台运行fun #
#for Wanggy 2012-01-25 #
#note: #
#fun_num Fun function Background Run number #
#sql_num How many times per function SQL runs #
#**********************
command function : Cutting files, cutting files in units of behavior or in bytes
command Syntax :
Split [–help][–version]
Split [-][-l , in number of rows
Split [-B ][-c
The output file name refers to the cut file as a prefix.
1. Cutting
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