Linux Memo __linux

Source: Internet
Author: User
Xargs
Kill process According to keyword
ps-ef | grep keyword | awk ' {print $} ' | Xargs kill-9
Watch
Real-time monitoring of Redis values
watch-n 0.2 ' redis-cli-h 127.0.0.1-p 6379-a password, Llen List_key ' based on watch command
netstat
/**
 *-A,--all,--listening     display all sockets (default:connected)
 *-E,--extend               display Other/more I nformation
 *-P,--programs             display pid/program name
 for sockets *-N,--numeric              don ' t resolve names< c13/>*/
//View all TCP connections under Linux and number
netstat-n | awk '/^tcp/{++s[$NF]} end {for (a) print a, S[a]} '
//root According to the keyword view TCP connection information
NETSTAT-ANEP | grep-e "Key1.*key2"
grep
Or operation, add-e parameter
grep-e "Key1|key2"
//or operation, use Egrep extension to match
egrep "Key1|key2"
//or operation, matching word inside plus backslash \, Start opening egrep extension regular match
grep "Key1\|key2"
//with operation, same or Operation
grep "Key1.*key2"
grep-e "Key1.*key2"
egrep "Key1" . *key2 "
tcpdump
/**
 * Monitor packet *    host specifies IP receive and send packets * Port    Current host 80 port receive and send packets
 *    src specified source
 *    DST Specifies target
 *-i    specify NIC
 *    -NN Digital Display port number
 *    -A to display packets in ASCII *-    x Display packets in 16-in and ASCII-s to    output the TCP's serial number in absolute terms, not relative value
 *    -VV output Detailed message information
// Gets the packet that IP communicates with the current host 80 port, and displays in ASCII
# tcpdump-i Eth1-nna  host xxx.xxx.xxx.xxx and TCP port
Gets the packet that IP communicates with the current host 80 port, displaying in 16 and ASCII, showing the absolute value of serial number
# Tcpdump-i ETH1-XSNNVV host xxx.xxx.xxx.xxx and Port
Get IP Send to local port 80 package
# tcpdump-i Eth1-nna src host xxx.xxx.xxx.xxx and TCP port
//Get local 80 port packets sent to IP, and in 16 and ASCII Show
# tcpdump-i ETH1-NNX DST host xxx.xxx.xxx.xxx and TCP port 80
ifconfig
View all cards in this machine
# ifconfig-a
Sysctl Ulimit Iftop
Real-time Monitoring system Traffic
# Iftop

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.