我思故我在 – 笛卡尔
awk 'NR==FNR{a[$1]++}NR>FNR&&a[$1]>1' test test
netstat -atn | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
cat access.log | awk -F["/"] {'print $5,$0'} | awk '{if($11 ~ /^[0-9]+$/) S[$1]=S[$1]+$11;S["TOTAL"]=S["TOTAL"]+$11} END {for(a in S) print a, S[a]}' | sort -k 2,2 -nr 1>result
route -n
route add -net 192.168.200.0 netmask 255.255.255.0 dev eth0 gw 192.168.200.254
route del -net 169.254.0.0 netmask 255.255.0.0 dev eth0 gw 169.254.0.1
taskset -cp 8,9 11441
将PID为11441的线程绑定到8,9核心上。
#!/bin/bash
# Get current swap usage for all running processes
# writted by xly
function getswap {
SUM=0
OVERALL=0
for DIR in `find /proc/ -maxdepth 1 -type d | egrep "^/proc/[0-9]"` ;
do
PID=`echo $DIR | cut -d / -f 3`
PROGNAME=`ps -p $PID -o comm --no-headers`
for SWAP in `grep Swap $DIR/smaps 2>/dev/null| awk '{ print $2 }'`
do
let SUM=$SUM+$SWAP
done
echo "PID=$PID - Swap used: $SUM - ($PROGNAME )"
let OVERALL=$OVERALL+$SUM
SUM=0
done
echo "Overall swap used: $OVERALL"
}
getswap
#getswap|egrep -v "Swap used: 0"
netsh wlan set hostednetwork mode=allow ssid=livdran2012 key=100100100
netsh wlan start hostednetwork
enjoy the life !!!