The first chapter skips, the bottom starts from the second chapter, everybody understands.PS: Here is a very important thing when my egg hurts, very! Already code article code to the fourth chapter, the tragedy of the wrong browser button to refresh,
In the process of doing keyword cleaning, you need to filter out a class of words that do not conform to the end of a word, the idea is to put this batch of words according to the last word sort, so think of the first of these words to reverse, such
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:
Question: Https://www.jinshuju.net/f/EGQL3D
Language: Shell (Bash)Operation mode:SH num-game.sh digit 1 digit 2 Number 3If you do not want to use the method of passing numbers, you can modify num-game.sh line 9th tonum=$*Tonum= ' number 1 digit 2
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
First Use W to view the current logged-in user, run the W command is the current user, need to keep, other all kicked off.
Method One, the traditional way to find the names of other terminals, and then find the response process to kill
Copy
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
Linux how to count the current directory under the number of files, and how many directories?
Write a script with the shell below, put it in the current directory, and execute it.
Copy Code code as follows:
#!/bin/bash
#脚本名称
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
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
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
The main purpose is to restart the background of more important processes, if the use of killall-9 forced kill, may cause problems. such as database processes. The code is as follows:
Copy Code code as follows:
#!/bin/sh
If [-Z "$"];
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 IP that lists the most visited times of the daycommand:
Copy Code code as follows:
Cut-d--F 1/usr/local/apache2/logs/access_log |uniq-c | Sort-rn | Head-20
Principle:
Copy Code code as follows:
cut
For example, to split test= "AAA,BBB,CC cc,dd dd", you can
Copy Code code as follows:
arr=$ (Echo $test |tr "," \ n ")
I can do that.
Copy Code code as follows:
old_ifs= $IFS
Ifs= ', '
Arr= $test
ifs= $OLD
When a program fails, there are times when you want to troubleshoot problems by understanding the system tuning that the process is executing. You can usually use Strace to track. But Strace is no help when the process is already in the D state
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