centos6.0 is installed, many packages are not installed because a minimal installation is selected, so some commonly used commands are not supported, as follows:# SCP-bash:scp:command not found
My solution is to find the package on the SCP on a
1. Methods of primitive violence
Copy Code code as follows:
mylinux:/home/zhanhailiang/public_html # Killall Nginx
2, gentle point of approachFinds the PID for the specified process and kill|kill-usr1 it off
Copy Code code as
Description: The subscript for an array in the shell defaults to the 0 start
1, put the string in the array, get its length
Copy Code code as follows:
#!/bin/bash
Str= "A B--n D"
Array= ($STR)
length=${#array [@]}
Echo
Because the backstage input colleague, uploads the file the time, to file the same name, but different suffix name, because the file path is very deep, about 10 layers, each layer has dozens of files, so manually find a very troublesome, so write a
Use shell script to compute the Linux NIC traffic, the most critical point in the method:
Copy Code code as follows:
Ifconfig $eth _name | grep bytes | awk ' {print $} ' | Awk-f: ' {print $} '
The flow of input and output is
1, File type introductionLinux systems mainly include the following seven types of files: D directory-normal file L Symbolic link s socket file B block device file c character device file p named pipe file
2, Regular expressionRegular expressions
This paper introduces several common Linux monitoring scripts, which can realize the automatic monitoring and alarming of host network card traffic, system condition, host disk space, CPU and memory usage. According to their own needs to write a
The first description of our configuration file, are similar format, if the intranet is 192.168.0.3, the extranet is 123.123.123.123, the configuration file is as follows:
$db [' salver '] [' hostname '] = ' 192.168.0.3:3306 ';$db [' salver '] ['
The shell also has a real debug mode. If there are errors in the script "Strangescript", you can debug this:
Sh-x Strangescript
This executes the script and displays the values of all the variables.
The shell also has a pattern that does not
=================================================
This article for Khler original, reprint must ensure that this article complete and completely retain the original author information and this article original
Port forwarding under Windows is typically a self-contained NAT and Porttunnel, Portmap
Linux Lower port forwarding mapping program called RINETD, boot method rinetd-c/etc/rinetd.conf, Pkill rinetd shutdown process
Tools Home:
First, receive the fixed length of the parameter
Copy Code code as follows:
[Root@svn shell_example]# Cat params.sh
#!/bin/bash
#传参测试脚本
echo "My name is ' basename $ ' I ' called as $"
echo "My I-parameter is: $"
echo "My
Process state variables
1, $$ get the current shell process number (PID)2, $! executes the PID of the previous instruction3, $? Gets the return value that executes the previous command (0 is a success, Non-zero is a failure, this is very common)4. $
1. Show the top 10 processes consuming memory/cpu
Copy Code code as follows:
PS aux | Sort-nk +4 | Tail
PS aux | Sort-nk +3 | Tail
2. View process
Arrange by memory from large to small
Copy Code code as follows:
The most recent script always needs to be computed, and every time awk is cumbersome, it encapsulates the subtraction of awk, and each time the direct source math.sh is invoked.There are some points to be pointed out so as not to forget in future
The process is written in a script, the principles are written in the comments, you understand. One-click operation is sudo bash xxx.sh
Copy Code code as follows:
#!/bin/bash
#cd到临时目录创建配置文件
Cd/tmp
(Cat
Setoutputfilter
Demand
I wrote this script two days ago when I met the need to extract a file in a 10-story folder.
A file structure like the following:
Copy Code code as follows:
Dir1
├──a
│├──b
││└──file1
│└──file2
├──c
│└──d
│├──e
INI file format is generally composed of sections, keys, values of three parts
Format:
[Section I.]First key = valueSecond key = second value[Section II]First key = Val1,val2,val3Example:
Copy Code code as follows:
[COM]
Kinggoo =
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