Linux下检测性能的常用命令

性能检测命令
top
free
df
uptime
last
history
vmstat 1
sar
iostat
netstat -an
nmap -sT -O localhost
uname -r
chkconfig --list
w
du -ms
netstat -n -p -t | grep SYN_RECV | grep :80 | wc -l
ps -aux | grep imap
kill -9 <PID>
killall imapd
 
加入于2006.11.21
less /etc/sysconfig/iptables
less /etc/ssh/sshd_config
less /etc/passwd //look for new user
less /etc/group //look for new group or if have new user in root group
less /etc/rc.d/rc.local
 
Monitor Opening Port
# nmap –sT –O localhost
  834/tcp   open  unknown
# cat /etc/services | grep 834 //查看834端口是否和任何已知服务相关
# netstat –anp | grep 834 //p选项揭示了打开834端口的进程IDPID
# lsof –i | grep 834
 
查找或删除正在使用某文件的进程
fuser filename
fuser -k filename
 
 
yum clear all
yum -y update
    if you find "Error: Cannot find a valid baseurl for repo", try to ping [url]www.centos.org[/url] and check iptables policy. 
  if you find "You may also check that you have the correct GPG keys installed",then:
uname -r
find / -name RPM-GPG-KEY-* //number:version about CentOS
rpm --import /usr/share/doc/CentOS-release-3/RPM-GPG-KEY-centos3
 
 
//change IP address:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
//add default gateway
route add default gw 192.168.18.1 dev eth0
本文转自你是路人甲还是霍元甲博客51CTO博客,原文链接http://blog.51cto.com/world77/283679如需转载请自行联系原作者

world77
上一篇:jsoup_解析任意网站,做任意网站客户端


下一篇:分布式架构(一)