I do not know if you have the same shoes have no management of hundreds of Linux operating system experience, although through SSH private key can be password-free landing, but every day input dozens of times the server IP address, I really like to
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,
1. Preface
Time is very important to the operating system, from the kernel level to the application layer, the time expression and precision of the same. The Linux kernel uses a constant named Jiffes to compute the timestamp. Application layer has
1.CD-The function is to quickly switch to the previous directory , as follows:
Copy Code code as follows:
amosli@amosli-pc:~$ CD learn/fd/
amosli@amosli-pc:~/learn/fd$ CD-
/home/amosli
2.dirs: Display the directory stack,
Category: Programs
WshShell objects
ProgID Wscript.Shell
FileName Wshom.ocx
CLSID f935dc22-1cf0-11d0-adb9-00c04fd58a0b
IID f935dc21-1cf0-11d0-adb9-00c04fd58a0b
The following table describes the properties associated with the WshShell
Use the shell to quickly generate a sitemap map file in XML format, which is suitable for small and medium sized websites. In this case, a sitemap file with 12,053 URLs is generated and only spents 4.3 seconds! The shell code is as follows:
Copy
A note earlier, just recorded two lines of code, put out the words is also a low quality page, so set up in order to only be visible, tonight to add.
Remember when the scene should be submitted sitemap when Baidu old hint of the wrong URL, cause
Method 1:
Copy Code code as follows:
For file in ' ls '; Do MV $file $file. txt; Done
Method 2:
Copy Code code as follows:
Find. -type f |xargs-i mv {} {}.txt
There are some unsuccessful trials,
On the internet to see this single flow of the script, very good.
Copy Code code as follows:
#!/bin/sh
Usage () {
echo "Usage: $ [i INTERFACE] [-S INTERVAL] [-C COUNT]"
Echo
echo "-I INTERFACE"
echo "The interface to monitor, and
CSH Example Reference:
Copy Code code as follows:
#!/bin/csh-vx
#csh-VX Show the command before running to help debug
#just to check syntax#csh-N $
#argvif ($ #argv echo "Sorry, but you entered too few parameters"echo "Usage: $
As a Linux SA, many parts of the day-to-day operation of the script, and the server's IP is generally static IP or Mac binding, of course, the latter is relatively cumbersome to operate, and the former we can set the host name, IP information,
Do unix/linux under the development, scripting skill is indispensable, as Shell programming, is also a profound technical field, here in order to learn, write a simple IP address is the legal micro-script program, this small program is also very
#!/bin/sh #测试各种字符串比较操作. #shell中对变量的值添加单引号, the difference between the hot quotes and the not added: it is irrelevant to the type, that is, not adding quotes into the string type, #单引号不对相关量进行替换, if the $ symbol is not interpreted as a variable
The code is as follows:
Copy Code code as follows:
#! /bin/bash
function Read_file () {
For line in ' cat $ '
Todo
If [' Echo $line |grep ' ^[a-za-z0-9_-]*@[a-za-z_-]*\.[ a-za-z_-]*$ "'];then
echo $line >> Result.txt
Else
Check to see if the remote port is open to bash:
Copy Code code as follows:
echo >/dev/tcp/8.8.8.8/53 && echo "Open"
To get a process into the background:
Copy Code code as follows:
Ctrl + Z
To move a
Now in order to save money, I used a shell script, simply write a monitoring. By Curl a fixed page of 200 status code, if it is 200, said the site is normal, if not 200 automatically restart the site, and then send mail to QQ mailbox. QQ on their
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.