Process view for Linux

Source: Internet
Author: User

Linux is a multi-user system Sometimes you need to know what other users are doing. In this section, you will also be exposed to multi-user content while Linux is a multi-process system that often requires some provisioning and management of these processes to be managed the first thing you need to know is what is happening in the current process? What is the status of the process? And so it needs a process to see the work of the WHO command this command is primarily used to view the current user situation on-line This command is useful if the user wants to establish instant messaging with other users, such as using the Talk command, the first thing to be sure is that the user is indeed online or the talk process cannot be built and the system administrator wants to monitor each Users to use the WHO command at this moment

the common syntax format for the WHO command is as follows Who[imqsuwht][count][idle][heading][help][message][mesg][version][writable][file][ami] All options are optional-that is, you can use the WHO command without any options when the WHO command will display the following three items loginname login user name Terminalline use end device Logintime log on to the system if you give two non-option parameters then the WHO command will only show the shipped User name of the WHO program logon terminal and logon time usually these two parameters are ami that is, the command format for whoami under the common parameters of the WHO command to explain the role of M and WhoAmI as shown in the user name running the program Qcount only shows the user's logon account and the number of logged on users this option takes precedence over any other selected Item S is ignored primarily for compatibility with other versions of the WHO command Iuidle displays the last time the user has worked on the system since the logon time, which is often said to be in a daze time. The symbol indicates that the user is still active in the previous second, and that the user has been idle for more than an hour hheading display a row and column headings commonly used The title is shown in the table

Who command output common headings

Caption Description user login account line user login use terminal logintime user logon time idle user idle aftertaste Haiyun ne? PID User Login Shell process idfrom user network address wtmesgmessagewritable and S option to display a character after the login account to indicate the user's information status + allow write information is not allowed to write information? I can't find the terminal. Help on standard output display the version information on standard output the following are some basic uses of the WHO command if you need to see which users on the system can use the WHO command directly

[Example] view the user logged on to the system

$whorootttyMar: FoxyttyMar:rootttyMar:bbsttypMar: (rivernet) You can see that the system has a total of four users now. Generally this will allow you to understand the general situation of the logged-in user, but sometimes the above display is not so intuitive because there is no title description is not easy to understand at this point you need to use the H option

     [example) View details of the logged-on user

    Type $whouh displays the following userlinelogintimeidlefromrootttymar:foxyttymar::rootttymar::bbsttypmar: (rivernet) So at a glance where the U option specifies that the user's idle time is displayed so you can see an idle entry for the first root user is the one that indicates that the user is still active in the previous second and that the other user has a time later known as idle time the result of using the WhoAmI format command Riv Ernet!rootttymar: Visible only the user who is running the WHO command is not available at this time. The WHO command is very simple to use and can be used to accurately grasp the user's situation so using a very broad w command This command is also used to show users logged on to the system but unlike who, the W command is more powerful. It can not only show who logged in to the system You can also show what these users are currently doing and the statistics are more detailed and scientific than the WHO command. The W command is an enhanced W command for the WHO command displays items in the following order the current time the system boots to the present time the average load of the logged-on user system in the last seconds and seconds of each user's individual The data item display order is as follows login account terminal name remote hostname logon time idle time jcpupcpu the command line that is currently running the process where jcpu time refers to the time taken by all processes that are connected to the terminal (TTY) and does not include the past background job time but includes the current running background job Pcpu time refers to the time taken by the current process (that is, the process displayed in the What item) the specific usage and parameter syntax format of the command is described below W[husfv][user] The following parameter description h does not display the title U ignore the user name when listing the current process and CPU time this is primarily used to execute the SU command after the condition s use short mode does not display logon time JCPU and pcpu time F toggle Display from entry that is the remote host name entry The default value is not to display the remote host name of course the system administrator can make a Changes that show the item to the default V display version information the user only shows the relevant situation for the specified users

     [example) displays the details of the user who is currently logged on to the system

    $w:p mupminusersloadaverage:[email protected]:p M:ssswfoxytty:pm:ssbashroottty:pmssstelnetbbs Bbsttyprivernet: PMSSSBBSHRIVERNETPS Command PS Introduction of the previous two commands are used to view the current system users of the situation here to see the situation of the process this is also the topic of this chapter to monitor and control the process of the first need to understand the current process of the situation is to see the current process and the PS command is the most basic and very strong Large Process View commands use this command to determine which processes are running and running in a state process whether the end process is dead or not, which processes are taking up too much resources, and so in short, most of the information is the PS command and its parameters that can be obtained by executing the command the PS command is most commonly used to monitor background process performance because the background process is not These standard input/output devices for communication, so if you need to detect them, you can use the PS command syntax format as follows ps[options] The following is a description of the command options e show all processes f full format H do not display the title L long format w wide output a shows all processes on the terminal including other user processes R only shows processes running X show no control terminal process o[+|] K[[+|] K[...] Displays the list of processes according to the multilevel sort order specified by the shortcut key in SHORTKEYSKK the default order of the different formats for PS specifies that these default orders can be overridden by the user's designation + The character is an optional character that is reversed in the direction of the specified key PIDs is only listed to pay Sunrise phlegm that Gong 8 Uighur 蘄 D use a comma to separate the process list must be preceded by the last option of the command-line argument immediately after the middle cannot insert spaces such as PSF The following describes the long command-line options These options use the beginning sortx[+|] Key[[+|] Key[...] Selecting a multi-letter key + character from the Sortkeys segment is optional because the default direction is in ascending or dictionary order such as psjaxsort=uidppid+ PIDHELP Display Help information version displays the release information for the command in the previous option description, the sort key is then further explained in order to note that the value used in sorting is the intrinsic value used by PS is not used only for some output formats

sort key List short format long format description

Ccmd executable simple name ccmdline full command line fflags long mode flag GPGRP process Group Idgtpgid control TTY Process Group Idjcutime Cumulative User Time Jcstime cumulative system time Kutime User Time Kstime system time Mmin _flt number of minor page faults Mmaj_flt the number of primary page faults Ncmin_flt cumulative minor page faults ncmaj_ Flt Cumulative Main Page Error osession dialog idppid Process idpppid parent Process Idrrss resident Size Rresident resident page ssize memory size (Kbytes) sshare number of shared pages Tttytty minor device number Tstart_ Time process started Uuiduiduuser user name Vvsize Total amount of virtual memory (bytes) ypriority kernel Scheduling Priority Common PS command parameters the parameters described in the previous two sections may make the reader feel a bit scary actually this is a very easy to use command general users only need to master some of the most commonly used commands Parameters can be the most commonly used three parameters are Uax below will illustrate its specific usage by example

[Example] log in to the system as root

View Current process status $pspidttytimecommandttyp::bashttyp:: PS you can see that the displayed items are divided into four items in turn PID (process ID) TTY (terminal name) time (Process execution times) command (command line input for the process) you can use the U option to view the process owner and some other details as shown below $PSUUSERPID%CPU %memuszrssttystatstarttimecommandtestttypsnov:bashtestttyprnov: PSU having a horizontal line in front of the bash process means that the process is the user's login shell so for a logged-in user, only one of the processes with dashes can be seen%cpu% Mem Two options The former refers to the percentage of CPU time and total time that the process consumes, which refers to the percentage of memory and total memory that the process consumes. In this case, all the control terminal processes are seen, but for other processes that do not have control of the terminal, they are not observed, so it is necessary to use the X option to observe all process conditions


Process view for Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.