⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lsg20.htm

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTM
📖 第 1 页 / 共 3 页
字号:
<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







q







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Forces top to refresh without a delay</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







S







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Uses cumulative mode (the CPU time each listed process shows includes any children the process spawned)</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







s







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Runs top in secure mode (disables interactive commands)</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







i







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Ignores idle or zombie processes</FONT>







</TABLE><P>The top command can be very useful when you are tweaking a system's performance or want to see how heavily used the system is when a large number of users or processes are involved. Many system administrators run top with a slow delay (such as every 60 seconds) on a space terminal or console window throughout the day to get a fast assessment of the system's performance and load. If you do run top for a long period, use the s option to switch on secure mode. This option disables many of the interactive commands that can enable any user with access to the top screen to manipulate processes.







<BR>







<P>The output from the top command shows several summary lines at the top of the screen, followed by a list of the most CPU-intensive processes:







<BR>







<PRE>







<FONT COLOR="#000080">1:58pm up 59 min, 2 users, load average: 0.13, 0.34, 0.98







26 processes: 25 sleeping, 1 running, 0 zombie, 0 stopped







CPU states: 0.9% user, 6.4% system, 0.0% nice, 92.7% idle







Mem: 14620K av, 6408K used, 8212K free, 4632K shrd, 2328K buff







Swap: 0K av, 0K used, 0K free







 PID USER PRI NI SIZE RES SHRD STAT %CPU %MEM TIME COMMAND







 236 root 19 0 93 316 344 R 7.3 2.1 0:00 top







 1 root 1 0 48 232 308 S 0.0 1.5 0:00 init







 63 root 2 0 388 556 572 S 0.0 3.8 0:00 -bash







 209 root 1 0 98 320 356 S 0.0 2.1 0:00 in.telnetd







 24 root 1 0 60 228 296 S 0.0 1.5 0:00 /usr/sbin/crond -l10







  K







 6 root 1 0 36 164 336 S 0.0 1.1 0:00 bdflush (daemon)







 7 root 1 0 36 168 340 S 0.0 1.1 0:00 update (bdflush)







 38 root 1 0 73 280 332 S 0.0 1.9 0:00 /usr/sbin/syslogd







 40 root 1 0 44 240 320 S 0.0 1.6 0:00 /usr/sbin/klogd







 42 bin 1 0 84 240 320 S 0.0 1.6 0:00 /usr/sbin/rpc.portmap







 44 root 1 0 76 292 320 S 0.0 1.9 0:00 /usr/sbin/inetd







 46 root 1 0 68 212 304 S 0.0 1.4 0:00 /usr/sbin/lpd







 51 root 1 0 116 280 376 S 0.0 1.9 0:00 /usr/sbin/rpc.nfsd</FONT></PRE>







<P>The top utility displays several useful pieces of information in the first few lines. The uptime display on the first line shows the total amount of time the system has been up since the last reset. Following the uptime are three load averages that are constantly updated. The load averages show the average number of processes run in the last one, five, and fifteen minutes.







<BR>







<P>The total number of processes that are running at the time of the snapshot are shown on the second line, broken down following the total into the number of processes currently running, sleeping (not executing), zombie (status unsure or defunct), and stopped.







<BR>







<P>The CPU states line (the third line of the header) shows the percentage of CPU time in user mode, system mode, nice tasks, and idle. (A nice process has a negative nice value, which sets the priority of the process. Note that a nice task is counted by Linux as both a user task and a system task, so the total of the process values may add up to more than 100 percent.)







<BR>







<P>The fourth header line of the top output shows memory usage, including the amount of available memory, free memory at the moment of the snapshot, currently used memory, the amount of shared memory, and the amount of memory used for buffers. The last header line shows the swap statistics, which reflect the use of the system's swap space. The line shows the total swap space, available swap space, and used swap space. Following the header is the list of CPU-intensive processes, structured like the ps command's output.







<BR>







<P>While top is running, you can issue some commands to alter its behavior (unless you started top with the -s option to disable interactive commands). The following interactive commands are available:







<BR>















<TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







^L







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Redraws the screen</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







h/?







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Displays help</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







k







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Kills a process (you are prompted for the PID and the signal level such as 9 or 15, as discussed earlier under the kill command)</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







i







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Ignores idle and zombie processes</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







n/#







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Changes the number of processes displayed</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







q







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Quits</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







r







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Renices a process (you are prompted for the PID and the nice value)</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







S







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Toggles cumulative mode</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







s







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Changes the delay between updates</FONT>







</TABLE><P>Note that some terminals cannot display the output of the top command properly. When run, top should clear the entire screen and display a full screen of information. If you see overlapping lines or the screen has large blank areas, the terminal is not properly supported for top output. This problem<A NAME="I2"></A> often occurs when you use telnet across a network or emulate a terminal like a VT100.







<BR>







<BR>







<A NAME="E68E112"></A>







<H3 ALIGN=CENTER>







<CENTER>







<FONT SIZE=5 COLOR="#FF0000"><B>Summary</B></FONT></CENTER></H3>







<BR>







<P>This chapter has shown you how to obtain listings of the processes currently executing on your Linux system and how to terminate those processes when they require it. Although you may not have to use this knowledge often, every operating system has occasions when something gets out of hand and needs you to control it. The problems multiply as the number of users increases. Process commands enable you to correct the problem without terminating the operating system.







<P ALIGN=LEFT>























































</td>
</tr>
</table>

<!-- begin footer information -->



</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -