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 �CsT �CO localhost
  834/tcp   open  unknown
# cat /etc/services | grep 834 // 查看834 端口是否和任何已知服务相关
# netstat �Canp | grep 834 //p 选项揭示了打开834 端口的进程ID PID
# lsof �Ci | 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

你可能感兴趣的:(linux,命令,职场,休闲,性能监测)