This article briefly describes how to use the Linux command –du, you need friends can refer to.
Du (disk usage)
Feature Description: Displays the size of the directory or file.
syntax:du [-abcdhhklmssx][-l ][-x
1 detect the number and status of links to the Web server:
Netstat-ant|awk ' {print $ \ t ' $} ' |grep:: FFFF: ' |sed-e ' s/::ffff://'-e ' s/:[0-9]*//' |sort|uniq-c| Sort-rn|head-10
Results:122 125.162.71.199 time_wait79.119.125.43
Name
WC is a tool for statistics, all spelled as: Word count (Word statistics)
Instance:
1. Statistics of rows
$WC –l File
2. Statistics of words
$WC –w File
3. Statistics of characters
$WC –c File
4. Number of characters in the statistical
Because the work needs to validate the data submitted by the user, this is a simple date validation example, you need to know the students can refer to.
The IF statement in the shell needs to make a regular judgment and check the grammatical
In general, use the "Telnet IP port" to determine the port pass, in fact, testing methods more than this one, there are many ways, the following small series to share several methods, the specific content please look down:
Preparing the Environment
Starting the system as fast as possible is very important for automation equipment. The system is able to start at a time that the user cannot perceive, which means that the power supply can be completely disconnected when no work is needed, rather
How to calculate the number of files and directories in the current directory
# ls-l * |grep "^-" |wc-l----to count files
# ls-l * |grep ' ^d ' |wc-l-----to Count dir
How do I just column subdirectories?
Or
In the previous blog, once wrote the implementation of automated test procedures, now developers need to know the process of being tested (this refers to the main process running on Linux) before the abnormal exit of the process state, such as
Each line that the Shell reads from standard input or script is called a pipe (pipeline); it contains one or more commands (commands) that are separated by one or more pipe characters (|).
In fact, there are many special symbols that can be used to
3.1 Find textgrep: Use POSIX-defined basic regular Expressions (BRE).Egrep: Using an extended regular expression (ERE).Fgrep: Fast grep. Use the optimized algorithm to match a fixed string rather than a regular expression.
The 1992 POSIX standard
Copy Code code as follows:
#!/bin/bash
#********************************#
#并发后台运行fun #
#for Wanggy 2012-01-25 #
#note: #
#fun_num Fun function Background Run number #
#sql_num How many times per function SQL runs #
#**********************
The Linux shell is much more powerful in programming than in Windows batching, whether in loops or operations. There is no comparison of data types. The following is a summary of how an individual operates on an array while in use.
1. Array
First, create a expect script ssh_expect, which reads as follows:
#!/usr/bin/expect-f
set hostname [lindex $argv 0]
set user [lindex $argv 1]
set passwd [lindex $argv 2]
s Et timeout
set force_conservative 1
if {$force _conservative} {
set
When the old horse wrote this version, I tested a simple reproduction of two 2003 version, when it is easy to use. I guess it's probably about 2003 dozen ms06014 patches. Kyo the solution at the freezing point forum, I studied this component this
A few examples of shell scripts, it feels good.
"Example: 001" to judge the input as a number, character or other
Copy Code code as follows:
#!/bin/bash
Read-p "Enter a number or string here:" Input
Case $input in
[0-9])
The real-time traffic of the NIC can be viewed through the Iptraf command, and the image is very intuitive.
I'm going to look at the network traffic on the test server today.
Copy Code code as follows:
[Root@localhost ~]# iptraf-d eth0
-
One, for loop1. Digital Segment Form
Copy Code code as follows:
For i in {1..10}
Todo
Echo $i
Done
2. Detailed list (character and number of items are not many)
Copy Code code as follows:
For File in 1 2 3
About the shell in the for loop usage a lot, always want to sum up, today on the Internet to see a summary of the use of the loop, feeling very comprehensive, so turn around research, HEI ...
Copy Code code as follows:
For
Because the work needs, often from the Windows host to access the remote Ubuntu server, each input account and the old password, feel very troublesome, so the reference online tutorial simple set up can automatically login remote host, very
With Mint for some time, download basic with Firefox, and sometimes download a few g of the game. But Firefox didn't find the option to download the shutdown. In this reason, wrote this.
download_shutdown.sh
#!/bin/bash
# Created by: Demo
#
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.