April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Linux common SHELL

Linux common SHELL
1 delete 0 byte file
find -type f -size 0 -exec rm -rf {} \;
2. view the process
Arranged in descending memory
ps -e -o “% C:% p:% z:% a” | sort -k5 -nr
Press the cpu utilization in descending order
ps -e -o “% C:% p:% z:% a” | sort -nr
4 print says in the URL cache
grep -r -a jpg / data / cache / * | strings | grep “http:” | awk -F’http: ” {print “http:” $ 2;} ‘
5 Check number of concurrent requests and TCP connection status http in:
netstat -n | awk ‘/ ^ tcp / {++ S [$ NF]} END {for (a in S) print a, S [a]}’

6. sed -i ‘/ Root / s / no / yes /’ / etc / ssh / sshd_config sed in this text in Root row, matching Root line, replace the no into a yes.
7.1 How to kill mysql process:
ps aux | grep mysql | grep -v grep | awk ‘{print $ 2}’ | xargs kill -9 (learned from the use awk)
killall -TERM mysqld
kill -9 `cat / usr / local / apache2 / logs / httpd.pid` try killing the process PID

The display runs three levels of open services:
ls /etc/rc3.d/S* | cut -c 15- (learned from the use of cut, intercept data)
9 How to display more information in the preparation of SHELL, with EOF
cat << EOF
+ ————————————————- ————- +
| === Welcome to Tunoff services === |
+ ————————————————- ————- +
EOF
10. for the clever use (such as to build mysql soft link)
cd / usr / local / mysql / bin
for i in *
do ln / usr / local / mysql / bin / $ i / usr / bin / $ i
done
11 take IP address:
ifconfig eth0 | grep “inet addr:” | awk ‘{print $ 2}’ | cut -c 6- or
ifconfig | grep ‘inet addr:’ | grep -v ‘127.0.0.1’ | cut -d: -f2 | awk ‘{print $ 1}’
12 memory size:
free -m | grep “Mem” | awk ‘{print $ 2}’

13.
netstat -an -t | grep “: 80” | grep ESTABLISHED | awk ‘{printf “% s% s \ n”, $ 5, $ 6}’ | sort
14 See Apache concurrent requests and TCP connection status:
netstat -n | awk ‘/ ^ tcp / {++ S [$ NF]} END {for (a in S) print a, S [a]}’
15. colleagues to statistics about the server because all of the following jpg file size, wrote a shell to him to count. Original use xargs to achieve, but he once treated a part, there are more than the sum of the …. out, the following command will be able to solve it.
find / -name * .jpg -exec wc -c {} \; | awk ‘{print $ 1}’ | awk ‘{a + = $ 1} END {print a}’

The number of CPU’s (multi-accounting multiple CPU, cat / proc / cpuinfo | grep -c processor), the more low system load, the number of requests per second can handle the more.
————————————————– ————————————————– —————-
16 CPU load # cat / proc / loadavg
Before checking whether the three output value exceeds four times the system logical CPU.
18 CPU load #mpstat 1 1
Check% idle is too low (eg less than 5%)
19 memory space # free
Check free value is too low can also use # cat / proc / meminfo
20 swap space # free
Check swap used value is too high if the swap used value is too high, further examination swap action is frequent:
# Vmstat 1 5
Si and the observed values ??are so large
21 Disk Space # df -h
Check for partition usage (Use%) is too high (eg over 90%) found a partition space close to exhaustion, you can enter the mount point of the partition, use the following command to find the most space-consuming file or directory:
# Du -cks * | sort -rn | head -n 10
22 disk I / O load # iostat -x 1 2
Check the I / O utilization (% util) exceeds 100%
23 Network Load # sar -n DEV
Check the network traffic (rxbyt / s, txbyt / s) is too high
24 Network Error # netstat -i
Check whether there is a network error (drop fifo colls carrier) can also use the command: # cat / proc / net / dev
The number 25 network connection # netstat -an | grep -E “^ (tcp)” | cut -c 68- | sort | uniq -c | sort -n
26 processes total # ps aux | wc -l
Check whether the normal number of processes (eg more than 250)
27 The number of runnable processes # vmwtat 1 5
Column gives the number of runnable processes, check whether it exceeds the system logical CPU 4 times

28 Process # top -id 1
Observe whether there is an exception process occurs
29 Network status check DNS, gateway, etc. are properly connected
30 users # who | wc -l
Check the login user is excessive (eg over 50) can also use the command: # uptime
31 system log # cat / var / log / rflogview / * errors
Check for unusual error log can also search for some unusual keywords, for example:
# Grep -i error / var / log / messages
# Grep -i fail / var / log / messages
32 core logging # dmesg
Check for unusual error logging
33 system time # date
Check the system time is correct
34 the number of open files # lsof | wc -l
The total number of checking whether too many open files
35 Log # logwatch -print configuration /etc/log.d/logwatch.conf, the Mailto set their own email address, start mail service (sendmail or postfix), so that you can receive a daily log report.
The default logwatch report only yesterday logs, you can use # logwatch -print -range all get all the log analysis results.
You can use the # logwatch -print -detail high to obtain more detailed log analysis results (not just the error log).
36 killed 80 port-related processes
lsof -i: 80 | grep -v “PID” | awk ‘{print “kill -9”, $ 2}’ | sh
37. clear zombie processes.
ps -eal | awk ‘{if ($ 2 == “Z”) {print $ 4}}’ | kill -9
38.tcpdump capture, data can be analyzed to prevent being attacked on port 80
# Tcpdump -c 10000 -i eth0 -n dst port 80> / root / pkts
39. then check the IP number of repetitions and small to large order note “-t \ +0” in the middle of two spaces
# Less pkts | awk {‘printf $ 3 “\ n”‘} | cut -d -f 1-4 |. Sort | uniq -c | awk {‘printf $ 1 “” $ 2 “\ n”‘} | sort -n -t \ +0
40. have php-cgi process to see how many activities
netstat -anp | grep php-cgi | grep ^ tcp | wc -l
chkconfig –list | awk ‘{if ($ 5 == “3: on”) print $ 1}’
41.kudzu view card model
kudzu –probe –class = network
Matching Chinese characters regex: [\ u4e00- \ u9fa5]
Commentary: Matching Chinese really is a troublesome thing, with this expression will be easier
Matching double-byte characters (including characters including): [^ \ x00- \ xff]
Commentary: can be used to calculate the length of the string (a double-byte character length gauge 2, ASCII character count 1)
Blank lines matching regular expression: \ n \ s * \ r
Commentary: can be used to remove blank lines
HTML tags matching regular expression: <(\ S *?) [^>] *> * </ \ 1> | <* />.?.?
Commentary: Too bad the version circulated on the Internet, this is only able to match the above section, for complex nested tags still powerless
And last match whitespace regex: ^ \ s * | \ s * $
Commentary: whitespace delete the line end of the line can be used (including spaces, tabs, page breaks, etc.), very useful expression
Matching Email address regex: \ w + ([-. +] \ W +) * @ \ w + ([-.] \ W +) * \ \ w + ([-.] \ W +) *.
Commentary: When a very practical form validation
Website URL matching regular expression: [a-zA-z] +: // [^ \ s] *
Comment: The spread of the Internet version of the function is very limited, to meet the basic needs of the above
Match the account is legitimate (letter beginning, allowing 5-16 bytes, allowing alphanumeric characters and underscores): ^ [a-zA-Z] [a-zA-Z0-9 _] {4,15} $
Commentary: When a very practical form validation
Matching domestic phone number: \ d {3} – \ d {8} | \ d {4} – \ d {7}
Commentary: matching forms such as 0511-4405222 or 021-87888822
Matching Tencent QQ number: [1-9] [0-9] {4}
Commentary: Tencent QQ number from 10,000 to start
Matching China Postal Code: [1-9] \ d {5} (?! \ D)
Commentary: China ZIP code for six figures
Matching ID: \ d {15} | \ d {18}
Commentary: China’s ID card for 15 or 18
Match ip address:… \ D + \ \ d + \ \ d + \ \ d +
Commentary: When extracting useful ip address
Match a specific number:
^ [1-9] \ d * $ // match the positive integers
^ – [1-9] \ d * $ // match negative integers
^ -? [1-9] \ d * $ // match integers
^ [1-9] \ d * | 0 $ // match non-negative integer (positive integer + 0)
^ – [1-9] \ d * | 0 $ // matching non-positive integers (negative integer + 0)
^ [1-9] \ d * \ \ d * |.. 0 \ \ d * [1-9] \ d * $ // match float
^ – (.. [1-9] \ d * \ \ d * | 0 \ \ d * [1-9] \ d *) $ // match negative float
? ^ – (..?. [1-9] \ d * \ \ d * | 0 \ \ d * [1-9] \ d * | 0 \ 0+ | 0) $ // match float
^ [1-9] \ d * \ \ d * |.. 0 \ \ d * [1-9] \ d * | 0 \ 0+ |?. 0 $ // match non-negative floating point (float + 0)
^ (-.. ([1-9] \ d * \ \ d * | 0 \ \ d * [1-9] \ d *)) | 0 \ 0+ | 0 $ // matching non-upright?. points (negative float + 0)
Commentary: When handling large amounts of data useful to note that amendments to the specific application
Match a specific string:
^ [A-Za-z] + $ // match a string of 26 English letters
^ [AZ] + $ // match by 26 uppercase letters of the alphabet composed of a string
^ [az] + $ // match a string of 26 lowercase letters of the alphabet consisting of
^ [A-Za-z0-9] + $ // match the string of numbers and 26 letters of the English
^ \ w + $ // matching string by numbers, 26 English letters or underscores the
Commentary: some of the most basic and most common expressions

1 build file links
(1) Fixed Link:
When you delete a file which is actually just deleted the link to the file, if a file has multiple files linked to really delete this file must remove all links to this file
Example: foo bar create a fixed file link for the file named
ln foo bar
Display file link information
ls -i foo bar
(2) a symbolic link: Similar to the windows shortcuts
ln -s source file name destination file name
2 Find a file
(1) find: by file name to find the advantage is to find a flexible, the disadvantage is the search time is too long
Format: find a path expression match
find / -iname myfile *
Description: iname for matching expression, which has more than 20 kinds of choice
Example: Find by size
find / -size 53k
(2) locate: Find by file name, but according to the index to find, so the speed is faster than find
Example: locate * .ps
(3) whereis: the search results can be displayed while the file is a binary file, source code and documentation storage location of
Example: whereis find
(4) grep string filename parameter
3 archive command: Archive role is to package multiple files into one file, but it does not compress each file
Format: tar – parameter target file name of the source file
Parameter List:
-c establish archive
-f archive to a file instead of a tape drive
-v during replication, to join the file is displayed on the screen
-t display each file list
-x unlock an archive file to the appropriate directory, and contrary -c
-w in each filing / unlock the file for each file when confirmation, to prevent misuse overwrite files
By filing reconciliation gzip file when filtering -z
Archive formats: tar -cvf list of files to be archived archive file name
Example: tar -cvf vnc.tar / root
Xie file formats: tar -xvf archive file name
4 compression and decompression command
gzip – parameter file name
Description: gzip with winzip software is different, it can only compress a file, so often used in conjunction with the tar command, gzip generally without any parameters, such as:
gzip mydoc.tar
Will produce mydoc.tar.gz compressed file in the current directory
Note: You can use tar -z file compression, for example, type the following command
tar -cvfz resarch.tar.gz / etc
The above command will be on file in / etc archive for research.tar, then use gzip to compress files generated research.tar.gz
In contrast, type the following command:
tar -xvfz research.tar.gz
5.RPM (Redhat Package Manager abbreviation). It is a powerful software package developed by Redhat management software
(1) installation package
rpm -i package name
(2) Uninstall one package
rpm -e package name
6. rights management file / directory
-rw-r-r – l
In addition to the above file permissions first letter back nine groups of three letters each, followed by representatives of the file owner, file group, and other users all the permissions on the file, where r represents read
Permissions, w write permission on behalf of, x behalf of the Executive authority. Catalog, x permission for representatives of the search. File permissions shown above represent the file belongs to the user is concerned, it has read and write permissions
; For other users only read access. This is also the general file permissions allocation.
Note: The directory permissions greater than the file permissions
7 Change the file / directory permissions
chmod permissions for the file name + user categories
User categories include the following:
a representative of all users
g represents the file belongs to a user group
o behalf of all the documents to other users outside the group
Rights include: r, w, x
Example: myfile belongs to the group of users with write permissions:
chmod g + w myfile
Example: All users can execute mybatch file
chmod a + x mybatch
Establishment (similar dos bat file) in 8.Linux script file
The difference is that with dos in dos to distinguish whether the file extension to perform, but in linux by adding x to set the file executable permissions
Example: clear set as executable script file
chmod -u + x clear
9 change their user and group files
chown parameter user: group file name
Example: chown tlc: book destfile
The respective user destfile set to tlc, user group is set to book
10. process management
When you enter a command in the command line, as long as the command plus an & operator, you can make this program running in the background. For example, type updatedb & can make this task performed in the background
ctrl + z can put the programs into the background while suspended
bg so continue to be suspended
fg to keep it in the background
ctrl + c to terminate a program run
11 View into the Program Status: ps
Details ps -l display process
ps -f display process tree to represent the superior-subordinate relationship between processes
ps -r display running processes
ps -m display memory usage
Program processes the highest top 12 display system
k kill processes
q Exit
13. kill command to terminate the process
14. manage users and user groups
The general command format to add users
useradd username parameter
Example: useradd staff1 role is to build user staff1, this time not set a password, so then if this user is logged, no need to enter a password. The default user working directory is / home / username
Common parameters:
The minimum set user id id, this value should be greater than 99 and greater than the existing users: -u user id
-g user group name: The user should belong to the specified user group
-d working directory: Specifies the user’s working directory
useradd -g guest -d / mydoc user
This command creates a user-user, it belongs to the guest group (if not in this group, then create it). Its working directory is / mydoc (If you do not have this directory, then create it)
Delete user-friendly format:
userdel username parameter
This command is only one parameter -r, expressed delete users delete the user’s working directory
15. create and modify password
Under linux system in addition to the root user must set a password, the other ordinary user’s password from a technical point of view is not set, but for safety reasons, are generally required to set a password. Set a password in Linux command passwd, it’s the general format is:
passwd -u username
Example: psswd wang1 will modify the user’s password wang1
Achieved with one shell statement: all updated more than 10 days under the current directory (including subdirectories) suffix to suffix .a file .b
for i in $ (find -name ‘* .a’ -a -mtime +10.); do mv $ i $ {i% *.} b;. done
find -name ‘* .a’ -a -mtime +10 |. xargs rename .a .b
Little or insurance
find -name ‘* .a’ -a -mtime +10 |. xargs -n1 -i rename .a .b
. find -type f -name “* .b” | awk ‘{cmd = sprintf (“mv% s% sa /”, $ 1, substr ($ 1,1, length ($ 1) -2)); system
(cmd)} ‘
for i in $ (find -name ‘* .a’ -a -mtime +10.); do mv $ i [color = red] $ b [/ color] {i% *.};. done

shell programming, to achieve the following functions:
/ There are 800 files in tmp path, file name format is: filename_YYYYMMDD_ serial number (001 to 999) .dat, cases
Such as: filename_20040108_089.dat
Now wants to rename these files, the new file name format is: filename_TODAY (current date) _ serial number (from 500 starts to reach
After 999 from 001) .dat,
For example: the filename_20040108_089.dat to filename_20041222_589.dat, pay attention to the new file name order
No need to order of the columns and the original agreement, namely to do the sorting process.
#! / usr / bin / bash
DEST_FILE_PART2 = “_` date ‘+% Y% m% d’`_”
EXT_NAME = “. Dat”
SRC_FILE_LIST = `find / tmp -name” * _ * _ * $ EXT_NAME “-print`
for each in $ SRC_FILE_LIST; do
DEST_FILE_PART1 = `echo $ each | awk -F” _ “‘{print $ 1}’`
OLD_NUM = `echo $ each | awk -F” _ “‘{print $ 3}’ |”. “Awk -F ‘{print $ 1}’`
DEST_FILE_PART3 = `expr $ OLD_NUM + 500`
[$ DEST_FILE_PART3 -gt 999] && DEST_FILE_PART3 = `expr $ OLD_NUM – 499`
&& DEST_FILE_PART3 = `printf% 03d $ DEST_FILE_PART3`
DEST_FILE = $ DEST_FILE_PART1 $ DEST_FILE_PART2 $ DEST_FILE_PART3 $ EXT_NAME
echo “mv $ each to $ DEST_FILE”
mv $ each $ DEST_FILE
done
1 extracted from a.log file contains “WARNING” or “FATAL”, while not contain “IGNOR” line, and then extracted with “:” The first five split
Field
2 write a script, just a simple subtraction, require prompt input variables
3. Shell script reading (interpretation functions performed below), please pick the following program or script errors, and explain what went wrong.
#! / bin / bash
# Monitoring cpuser the point port is normal
logname = “/ home / forum / log / lpointlog.wf”
flagfile = “/ home / forum / log / lognum.txt”
lodnum = sed -n “1,1 p” $ flagfile
newnum = wc -l $ {logname}
echo $ newnum> $ flagfile
totalnum = expr $ newnum – $ oldnum
tail -n $ totalnum $ logname | grep “POINT_THREAD WARNING”
if [$? == 0]
then
mail -s “cpuser point” port exception, handle! “test@aa.com </ dev / null
fi>
Answer:
1.
grep -E ‘warning | fatal’ file | grep -v ignor | awk -F “:” ‘{print $ 5}’

awk ‘/ as / && / end / {print $ 1};! / bd / && / end / {print $ 1};!’ in

/ A / {} line containing the A’s
! / A / does not contain a row of A
Line / A /, / B / containing A, B that contains the
/ A / && / B / includes A, B, and contains the line
/ A /, / B / &&! / C / includes A, B does not contain the line that contains the C’s
Line / A / &&! / B /, / C / &&! / B / A does not contain contain B, to contain and do not contain B, C
2.
#! / bin / sh
echo -n “input var1:”
read var1
echo -n “input var2:”
read var2
echo $ (($ var1 – $ var2))

3.
(1) command line replaced with anti-quotes
`sed -n” 1,1 p “$ flagfile`
(2) if [$? == 0] should be written as if [$? = 0], is used to determine whether the last command executed successfully
if [$? = 0]
then
echo success
fi
(3) The penultimate line should be> / dev / null, behind the last fi> remove
1 variable expansion, when the environment variable is not blank (space or tab key) when separated from the surrounding text,
Please use a more explicit form of braces.
$ Myvar = ‘This is my environment variable!’
$ Echo foo $ {myvar} bar
fooThis is my environment variable! bar

2 extracted from the file path for the file name and path name of the command basename, dirname
$ Basename /usr/local/share/doc/foo/foo.txt
foo.txt
$ Dirname /usr/local/share/doc/foo/foo.txt
/ usr / local / share / doc / foo

3 command substitution, the results of the implementation of a command assigned to a variable, use `, or $ ()
$ MYDIR = `dirname / usr / local / share / doc / foo / foo.txt`
$ Echo $ MYDIR
/ usr / local / share / doc / foo
$ MYDIR = $ (dirname /usr/local/share/doc/foo/foo.txt)
$ Echo $ MYDIR
/ usr / local / share / doc / foo
4 string truncation, $ {MYVAR ## * fo}, $ {MYVAR # * fo}, $ {MYVAR %% * fo}, $ {MYVAR% * fo}
5. If statement in bash, all boolean expressions are enclosed in square brackets with
if [“$ {1 ## *.}” = “tar”]
6 references, you need to deal with all metacharacters quoted as follows:
? * [] ‘”\ $;! & () | ^ # Newline tab
For a single meta-characters, can be \ meta character escaping.
For the entire string, you can add single quotes around the string (‘), will make the whole string metacharacters lose all special meaning.
All per word for the entire string with a few exceptions, the use of double quotes, double quotes prohibited except $ (variable) and `(backtick command domain) than
Character.

Requirements: Completion of this program in a script
1 has been removed from the file user.list given user name and user group, these users and groups to the system by the rules
2 has been given to read the user’s password from password.list in.

user.list follows
zhangsan adminuser, dbuser, updatauser
lisi dbuser, updatauser
wanger updatauser, wheel
#! / bin / bash
#group add
for x in ‘awk’ {print $ 2} ‘user.list | sed’ s /, / \ n / g ‘| sort | uniq -c | sed’ s / [^ a-zA-Z] // g ”
do
groupadd $ x &> / dev / null
done

#back message
if (($? == 0))
then
echo “Group Ok !!”
else
exit 1
fi

#user add
for i in ‘awk’ {print $ 1} ‘user.list’
do
for y in ‘awk’ {print $ 2} ‘password.list’
do
useradd $ i &> / dev / null
echo $ y | passwd -stdin $ i &> / dev / null
done
done

#back message
if (($? == 0))
then
echo “User Ok!”
else
exit 1
fi

#add users to groups

for ((q = 1; q <= 3; q ++))
do

usermod -G ‘awk “NR == $ q {print $ 2}” user.list | awk’ {print $ 2} “‘awk” NR == $ q {print $ 1} ”
user.list | awk ‘{print $ 1} “&> / dev / null
done

if (($? == 0))
then
echo “All Finished!”
fi

 

 

 

No. mission command combination
A delete 0 byte files find -type f -size 0 -exec rm -rf {} \.;
find. type f -size 0 -delete
2 Check the process, in descending order by memory ps -e -o “% C:% p:% z:% a” | sort -k5 -nr
3 Press cpu utilization in descending order ps -e -o “% C:% p:% z:% a” | sort -nr
4 print said cache in the URL grep -r -a jpg / data / cache / * | strings | grep “http:” | awk -F’http: ” {print “http:” $ 2;} ‘
Number of concurrent requests and TCP connection status 5 See http The netstat -n | awk ‘/ ^ tcp / {++ S [$ NF]} END {for (a in S) print a, S [a]}’
6 sed in this text in Root row, matching Root line, replace the no into a yes. sed -i ‘/ Root / s / no / yes /’ / etc / ssh / sshd_config
7 How to kill mysql process ps aux | grep mysql | grep -v grep | awk ‘{print $ 2}’ | xargs kill -9
killall -TERM mysqld
kill -9 `cat / usr / local / apache2 / logs / httpd.pid`
8 shows the operation of three-level open service (learned from the use of cut, intercept data) ls /etc/rc3.d/S* | cut -c 15-
9 How to display more information in the preparation of SHELL, with EOF cat << EOF
+ ——————— +
| === Welcome to Tunoff services === |
+ ——————— +
EOF
10 for usage (eg to build mysql soft link) cd / usr / local / mysql / bin
for i in *
do ln / usr / local / mysql / bin / $ i / usr / bin / $ i
done
11 take IP address ifconfig eth0 | grep “inet addr:” | awk ‘{print $ 2}’ | cut -c 6-
ifconfig | grep ‘inet addr:’ | grep -v ‘127.0.0.1’ | cut -d: -f2 | awk ‘{print $ 1}’
12 memory size free -m | grep “Mem” | awk ‘{print $ 2}’
13 See the connection port 80 and sort netstat -an -t | grep “: 80” | grep ESTABLISHED | awk ‘{printf “% s% s \ n”, $ 5, $ 6}’ | sort
Number of concurrent requests and TCP connection state 14 See the Apache netstat -n | awk ‘/ ^ tcp / {++ S [$ NF]} END {for (a in S) print a, S [a]}’
15 statistics about the server all of the following jpg file size find / -name * .jpg -exec wc -c {} \; | awk ‘{print $ 1}’ | awk ‘{a + = $ 1} END {print a}’
Number cat 16 CPU’s / proc / cpuinfo | grep -c processor
17 CPU load cat / proc / loadavg
18 CPU load mpstat 1 1
19 free memory space
20 disk space df -h
21 found a partition space close to exhaustion, you can enter the mount point of the partition, to find the most space a file or directory with the following command du -cks * | sort -rn | head -n 10
22 disk I / O load iostat -x 1 2
23 Network Load sar -n DEV
24 network error netstat -i
cat / proc / net / dev
25 The number of network connections netstat -an | grep -E “^ (tcp)” | cut -c 68- | sort | uniq -c | sort -n
The total number of 26 processes ps aux | wc -l
27 See process tree ps aufx
28 The number of runnable processes vmwtat 1 5
Check whether the 29 DNS Server is working properly, for example here in order to dig www.baidu.com @ 61.139.2.69 61.139.2.69
30 to check the number of users currently logged in who | wc -l
31 log view, search cat / var / log / rflogview / * errors
grep -i error / var / log / messages
grep -i fail / var / log / messages
tail -f -n 2000 / var / log / messages
32 kernel log dmesg
33 time date
34 have open handles several lsof | wc -l
35 network packet capture, direct output summary information to a file. tcpdump -c 10000 -i eth0 -n dst port 80> / root / pkts
36 and then check the IP number of repetitions and small to large order note “-t \ +0” in the middle of two spaces, use less command. less pkts | awk {‘printf $ 3 “\ n”‘} | cut -d -f 1-4 | sort | uniq -c | awk {‘printf $ 1 “” $ 2 “\ n”‘} | sort -n -. t \ +0
37 kudzu View card type kudzu -probe -class = network

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>