Linux?Top?command is a performance monitoring program which is used frequently by many system administrators to monitor Linux performance and it is available under manyLinux/Unix?like operating systems. The top command used to dipslay all the running and active real-time processes in ordered list and updates it regularly. It display?CPU usage,Memory usage,?Swap Memory,?Cache Size,?Buffer Size,?Process PID,?User,?Commands and much more. It also shows high?memory?and?cpu?utilization of a running processess. The top command is much userful for system administrator to monitor and take correct action when required. Let’s see top command in action.
<p class="wp-caption-text">Top Command Example
For more examples of Top command read :?
2. VmStat – Virtual Memory Statistics
Linux?VmStat?command used to display statistics of?virtual memory,?kernerl threads,disks,?system processes,?I/O blocks,?interrupts,?CPU activity?and much more. By default vmstat command is not available under Linux systems you need to install a package calledsysstat?that includes a vmstat program. The common usage of command format is.
# vmstat
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
r b swpd free inact active si so bi bo in cs us sy id wa st
1 0 0 810420 97380 70628 0 0 115 4 89 79 1 6 90 3 0
For more Vmstat examples read :?
3. Lsof – List Open Files
Lsof?command used in many?Linux/Unix?like system that is used to display list of all the open files and the processes. The open files included are?disk files,?network sockets,pipes,?devices?and?processes. One of the main reason for using this command is when a disk cannot be unmounted and displays the error that files are being used or opened. With this commmand you can easily identify which files are in use. The most common format for this command is.
# lsof
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
init 1 root cwd DIR 104,2 4096 2 /
init 1 root rtd DIR 104,2 4096 2 /
init 1 root txt REG 104,2 38652 17710339 /sbin/init
init 1 root mem REG 104,2 129900 196453 /lib/ld-2.5.so
init 1 root mem REG 104,2 1693812 196454 /lib/libc-2.5.so
init 1 root mem REG 104,2 20668 196479 /lib/libdl-2.5.so
init 1 root mem REG 104,2 245376 196419 /lib/libsepol.so.1
init 1 root mem REG 104,2 93508 196431 /lib/libselinux.so.1
init 1 root 10u FIFO 0,17 953 /dev/initctl
More lsof command usage and examples :?
4. Tcpdump – Network Packet Analyzer
Tcpdump?one of the most widely used command-line?network packet analyzer?or?packets sniffer?program that is used capture or filter?TCP/IP?packets that received or transferred on a specific interface over a network. It also provides a option to save captured packages in a file for later analysis. tcpdump is almost available in all major Linux distributions.
# tcpdump -i eth0
tcpdump: verbose output suppressed,use -v or -vv for full protocol decode
listening on eth0,link-type EN10MB (Ethernet),capture size 96 bytes
22:08:59.617628 IP tecmint.com.ssh > 115.113.134.3.static-mumbai.vsnl.net.in.28472: P 2532133365:2532133481(116) ack 3561562349 win 9648
22:09:07.653466 IP tecmint.com.ssh > 115.113.134.3.static-mumbai.vsnl.net.in.28472: P 116:232(116) ack 1 win 9648
22:08:59.617916 IP 115.113.134.3.static-mumbai.vsnl.net.in.28472 > tecmint.com.ssh: . ack 116 win 64347
For more tcpdump usage read :?
5. Netstat – Network Statistics
(编辑:孝感站长网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!