[ Pobierz całość w formacie PDF ]
.The ps command has nearly two dozen command-line options, and you can also list allrunning processes.See the ps manual page for more information.You can also use the topcommand, discussed next, to find and kill processes.Getting System Load Information with thetop and xload CommandsThe top command, found under the /usr/bin directory, is a system monitor that displaysstatistical information about how Linux is currently handling your memory, swap file, andprocesses.The top program also shows how long your system has been running, the status2 0 Basic System Administration 305of your CPU, the size of each process, and more.You ll typically use the top command byrunning it on a spare console, or separate X11 terminal window (see Figure 20.1).Figure 20.1The top commandprovides an ongoingdisplay of your system.The top command also has a number of interactive controls, including a help screen, accessedwith the question mark or the H key.You can also toggle various modes of the display, suchas listing processes by memory usage or limiting the number of processes displayed.This canbe helpful if you would like to monitor only the top five processes that require the greatestamount of your system s memory, and it can help you diagnose problems if your computerstarts unusual disk or swap file activity.You can also use top to interactively kill processes, using the K key, or change a process spriority (how much time the CPU devotes to a task) with the R key.The top program has19 different interactive commands, and you can customize its display by adding or removingdifferent information fields and lengthening or shortening the number of processes.See its2 0manual page for more information.The xload command, used under X11, provides a running graph of your system s load,instead of the top command s statistics.System loads vary from computer to computer, butyou can generally tell when your system is overloaded by inordinate disk activity, as processesare swapped back and forth from your swap file.The xload command can help give you avisual warning if you re running too many programs, and may be especially helpful if you rerunning X11 on a 8MB or 16MB Linux system.The xload command has eight different command-line options, and you can customize thecolor of the moving graphic, scale lines, or background. 306 Hour 20Determining How Long Linux Has Been Runningwith the uptime and w CommandsTheuptime command shows you how long Linux has been running, how many users are on,and three system load averages, for example:# uptime12:44am up 8:16, 3 users, load average: 0.11, 0.10, 0.04If this is too little information for you, try the w command, which first shows the sameinformation as the uptime command, and then lists what currently logged-in users are doing:# w12:48am up 8:20, 3 users, load average: 0.14, 0.09, 0.05USER TTY FROM LOGIN@ IDLE JCPU PCPU WHATbball ttyp0 localhost.locald 9:47pm 15.00s 0.38s 0.16s bashbball ttyp2 localhost.locald 12:48am 0.00s 0.16s 0.08s wThe w command gives a little more information, and it is especially helpful if you would liketo monitor a busy system with a number of users.Getting Network and Mail Information with thepppstats and mailstat CommandsThe pppstats command, found under the /usr/sbin directory, will give you a runningstatistical display on the status and activity of your PPP connection.The information issimilar to the output of the ifconfig command.To use the pppstats program, specify thePPP interface (usually 0) on the command after you have connected to your ISP:# /usr/sbin/pppstats 0in pack comp uncomp err | out pack comp uncomp ip24791 93 74 5 0 | 1922 72 54 4 1478 4 3 0 0 | 80 4 3 0 1129 2 0 0 0 | 160 3 0 1 21169 23 21 1 0 | 842 23 20 2 112748 28 27 1 0 | 730 27 18 9 09582 18 13 5 0 | 375 13 6 7 09399 18 16 2 0 | 268 12 8 4 071 3 2 0 0 | 80 4 3 0 1 [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • czarkowski.pev.pl
  •