The following script allows you to convert directories or file uppercase and lowercase letters as follows:
Copy Code code as follows:
#!/bin/sh
#edit by Www.jb51.net
# [: Upper:] [A-z]
# [: Lower:] [A-z]
# [:d igit:] [0-9]
Find a special embarrassing fact. I worked hard to Baidu data, want to use rewrite to achieve different domain name source station after the failure of automatic jump function, but the whole idea of missing a serious problem.
In my mind, make a
To ensure that the PHP page runs in the background, write a monitoring script, assuming that the program exits unexpectedly, you can automatically restart.
Shell Script/usr/local/scripts/receve.sh content:
#!/bin/bash
#funtion: Keep
The company has several servers running multiple memcached processes, in addition to monitoring their normal telnet, the existence of an instance to monitor their cache hit rate. Alarm for their cache hit rate.
There's a Perl written on the web
If you want to add a character after a variable, you can use the method:
Copy Code code as follows:
$value 1=home
$value 2=${value1} "="
Echo $value 2
Add the string variable you want to add {}, and you need to put $ outside.The
On the realization of the double linked list, the general textbook defines a two-way linked list node in the following ways:
Copy Code code as follows:
struct list_node{
Stuct List_node *pre;
Stuct List_node *next;
Elemtype data;
Case statements in the shell:You can match the contents of a variable with multiple templates, and then decide which part of the code should be executed based on a successful matching template.
Use format:Case matching Parent board inTemplate 1 [|
The first 8 bits of a character variable are intercepted by the Linux shell, with the following methods:
Copy Code code as follows:
1.expr substr "$a" 1 8
2.echo $a |awk ' {print substr (, 1,8)} '
3.echo $a |cut-c1-8
4.echo $
5
Why should I include a header file instead of a. c file
Test code:
Copy Code code as follows:
M.C file:
#include "t.c"
int main ()
{
Test ();
return 0;
}
Compile:
Copy Code code as follows:
GCC M.
Create 500,000 files first
Copy Code code as follows:
Test for I in $ (seq 1 500000)
For> do
for> echo Test >> $i. txt
For> Done
1 RM
Copy Code code as follows:
Test Time Rm-f *
Zsh:sure you want to
There are two uses, one is lazy do not have to submit code, the second is used on the remote server for regular backups.
Copy Code code as follows:
sudo gedit/etc/crontab
When you open it, join the line.
Copy Code code
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
1. The problem addressed
When you need to enter many commands at once, for example, to remove files from multiple directories at once
Copy Code code as follows:
CD Dir1
RM file1.temp
Cd.. /.. /dir2
RM-RF Dir3
When you
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 =
Uninstall and remove the WScript component
Wscript.Shell can invoke the system kernel to run DOS basic commands, which is harmful to system security. We're going to uninstall and remove the component to prevent this kind of trojan from
Recently managed a number of machines, there is a need to unify the change of an account username password, such as the QA account password changed to 1234, and later for scripting, very convenient implementation, but also used to modify the user's
Basic knowledge
Shell execution Mode SH xx.sh (file must have R permission) | | ./xx.sh (file must have X permission) Note: Sh xx.sh method is more safeFileName suffix. shShell content Opening #!/bin/bash | | #!/bin/sh | | #!/bin/csh | | #!/bin/ksh
Today on the Internet to see a web connection average time of the shell command, in their own machine tried, found that can not use, incredibly appear awk:fatal:division by zero attempted such a mistake, Mao's own changed the shell command.
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.