Shell Batch collection Love Station keyword library, the whim of the play, not perfect, first put out, later slowly update, although the function is simple, similar tools are also many ready-made, but after all, it is their own writing tools,
Speaking of function calls, I believe that we will not be unfamiliar, however, for beginners shell of me, the shell function call Way is a little let me not too accustomed to, I have gone a lot of detours, because the transfer parameters when a very
In the scripting process, the input of parameters is usually involved. For example, SH 1.sh 10 20, in the execution 1.sh this script, 10 is the first parameter, 20 is the second parameter. Sometimes, there is this confusion, that is, how many
1. List all directory usage and sort by size.
Copy Code code as follows:
Ls|xargs Du-h|sort-rn
#不递归下级目录使用du-sh
2. View the file exclusion with the # switch and blank line, suitable for viewing the configuration file.
Copy
1. Simple method
Copy Code code as follows:
$ b=$ ((5*5+5-3/2))
$ echo $b
29
In the Linux shell, we can use $ (()) to put an expression in parentheses to achieve the function of the operation.
2. Other methods:
Using:
First, the script idea
The first step is to rename the log file without having to worry about renaming the log file and losing the log when Nginx is not found. Before you reopen the log file for the original name, Nginx still writes to the file you
Use the MySQL shell command to read the database information, delete the specified fields, and the corresponding files of the field, the Linux platform.
The preceding variable is defined as the data base configuration
Copy Code code as
Copy Code code as follows:
#在后台执行 cmd command
CMD &
#命令序列. Execute multiple commands on the same lineCMD1; Cmd2
Execute multiple commands in a #在当前 shell in a set of forms{cmd1; cmd2;}
Execute multiple commands in a #在子 shell in a set
Because of the study of PHP, I also installed a XAMPP integrated environment package under Linux. But every time you start to enter the terminal, and then point Open/opt/lampp/, then sudo to perform manager-linux-x64.run operation, to open the XAMPP
My operating system is centos6.4.
Operating system: Rhel 6.2 x86_64
Download and install the Putty software package, I downloaded the putty-0.62-1.el6.rf.x86_64.rpmDownload the address below: HTTP://RPM.PBONE.NET/INDEX.PHP3
1. Remote Host IP
Recently the World Cup has come, has been busy between work and the World Cup, there is no time to manage my blog, today can only be the whole simple small shell to everyone. The company asked to delete one months before the backup file, so that the
Copy Code code as follows:
#!/bin/bash
Echo-e ' Date +%y%m%d%h%m '
Echo-e "Pid\t\tswap\t\tproc_name"
# Take out all directories in the/proc directory (the process name is the number is the process, others, such as sys,net, etc. store
Always want to write expect action in the Bash script, so I do not have to write two scripts to execute, and made a little achievement in the afternoon finally, to show you.
System: CentOS 5.x
1. Install expect first
Copy Code code as
These days found that CentOS system memory has been up, even if the Apache and MySQL closed, memory is not released, you can use the following script to free memory:Script content:
Copy Code code as follows:
#! /bin/bash
# Cache
Write a script to check whether the Apache process exists, if it does not exist, the display does not exist, if it exists, display the number of processes, when not equal to 10, notify the administrator in red font, and ask the administrator whether
But add the user, this one shell.users is enough. This may also be a new method of adding a user, possibly with the deletion of Net.exe and no ADSI. The code is as follows:
Js:
Copy Code code as follows:
var o=new activexobject
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.