netstat -i 开机到当前时间的网络流量
netstat 1 实时且详细的统计当前网卡流量
systat -if 也是实时的{我喜欢这个}
» 阅读全文
Submitted by Mobedu on 2009, April 20, 11:28 PM
netstat -i 开机到当前时间的网络流量
netstat 1 实时且详细的统计当前网卡流量
systat -if 也是实时的{我喜欢这个}
» 阅读全文
Submitted by Mobedu on 2009, April 16, 5:00 PM
别的不说,看附件就知道了
» 阅读全文
Submitted by Mobedu on 2009, March 31, 5:22 PM
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL) ALL
# Uncomment to allow members of group sudo to not need a password
# (Note that later entries override this, so you might need to move
# it further down)
# %sudo ALL=NOPASSWD: ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
» 阅读全文
Submitted by Mobedu on 2009, March 30, 9:40 PM
今天在论坛上看见有人在问这个问题,后面很多SHELL的高手在讨论,真的让我再一次深切的感受到了SHELL的博大精深,为之震撼。
|
[root@server2 ~]# netstat -ntu Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 127.0.0.1:8652 127.0.0.1:40193 TIME_WAIT tcp 0 0 127.0.0.1:8652 127.0.0.1:40192 TIME_WAIT tcp 0 0 127.0.0.1:8652 127.0.0.1:40196 TIME_WAIT tcp 0 0 127.0.0.1:8652 127.0.0.1:40199 TIME_WAIT tcp 0 0 127.0.0.1:8652 127.0.0.1:40201 TIME_WAIT tcp 0 0 127.0.0.1:8652 127.0.0.1:40204 TIME_WAIT tcp 0 0 127.0.0.1:8652 127.0.0.1:40207 TIME_WAIT tcp 0 0 127.0.0.1:8652 127.0.0.1:40210 TIME_WAIT tcp 0 0 192.168.32.62:41682 192.168.47.207:5432 TIME_WAIT tcp 0 0 192.168.32.62:41685 192.168.47.207:5432 TIME_WAIT |
netstat -ntu | tail -n +3 | awk '{ print $5}' | cut -d : -f 1 | sort | uniq -c| sort -n -r | head -n 5
tail -n +3 :去掉上面用红色标明的两行。
awk '{ print $5}':取数据的低5域(第5列),上面蓝色标明。
cut -d : -f 1 :取蓝色部分前面的IP部分。
sort:对IP部分进行排序。
uniq -c:打印每一重复行出现的次数。(并去掉重复行)
sort -n -r:按照重复行出现的次序倒序排列。
head -n 5:取排在前5位的IP 。
|
|
这样我们就很清楚的得到了我们想要的结果
» 阅读全文
Submitted by Mobedu on 2009, March 24, 5:27 PM
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'的解决
解决办法:
$ sudo chown mysql:mysql /var/run/mysqld
$ sudo /etc/init.d/mysql restart
» 阅读全文
Submitted by Mobedu on 2009, March 22, 1:06 AM
不说话 watch -d free
» 阅读全文
Submitted by Mobedu on 2009, March 3, 1:29 AM
花了一个下午的事件整理了一下ubuntu8.04server中安装的软件的中文说明{我主要是用来精简系统} 精简的进度很不理想.如果有朋友搞过.请留言活着加我Gmali ripsy110@gmail.com
» 阅读全文
Submitted by Mobedu on 2009, March 2, 6:40 PM
终于搞定了查询ubuntu下所有deb的依赖关系了
apt-cache depends $(dpkg-query -W -f='${Package} ')
根据unix shell 编程里面找到的 这个方法叫命令替换.
当使用$(command)的时候 括号里面的所有字符只用于构成命令.
» 阅读全文