Linux entry fourth day (bottom)--Program management (supplemental content)

Source: Internet
Author: User

1.PID

 trigger any event, the system will define him as a program, and give the program an ID, called PID, and according to inspire the user of this program and related attributes, give this PID a group a valid permission setting.

The PID used by different users of the same program is different:

  

2. Switch Login window can use ALT+F1~F7 to switch

3. Throw the instruction into the background of "execute" &

4. Drop the "current" job into the background "pause": [Ctrl]-z

5. Observe the current background work status: Jobs

6. Get the background work to the foreground: FG

[[email protected] ~]# FG%jobnumber Options and Parameters:%jobnumber:jobnumber is the work number (number). Note that the%It's dispensable! Example one: Working with jobs and then taking out the work: [[email protected]~]# Jobs-l[1]-14566Stopped Vim ~/. bashrc[2]+14567StoppedFind/ -Print[[email protected]~]# FG <== The work of that + is removed by default, i.e. [2]。 Immediately press [ctrl]-Z[[email protected]~]# FG%1<== directly rules out that work number! then press [ctrl]-Z[[email protected]~]# Jobs-l[1]+14566Stopped Vim ~/. bashrc[2]-14567StoppedFind/-print

7. Make work in the background of the state into operation: BG

8. Work in the management context: Kill

[Email protected] ~]#Kill-signal%Jobnumber[[email protected]~]#Kill-l Options and Parameters:-L: This is the lowercase of L, listing the currentKillWhat are the available signals (signal)? Signal: What kind of instructions do you give to the job at the back? WithMans 7Signal:-1: Re-reading the configuration file of the parameter (similar to reload);-2: represented with input by keyboard [ctrl]-c the same action;-9: Forcibly delete a job immediately;- the: Terminates a work in a normal program manner. and9is not the same. Example one: Identify background work in the current bash environment and "Force delete" the work. [[Email protected]~]# jobs[1]+ Stopped Vim ~/. bashrc[2] StoppedFind/ -Print[[email protected]~]#Kill-9%2; jobs[1]+ Stopped Vim ~/. bashrc[2] KilledFind/ -print# in a few seconds, you'll be given jobs again and you'll find2Work's gone! Because it was removed! Example two: Find out the background work in the current bash environment and "terminate" the work "normally". [[Email protected]~]# jobs[1]+ Stopped Vim ~/. Bashrc[[email protected]~]#Kill-sigterm%1# -sigterm and- theis the same! You can useKill-l to check! # But in this case, Vim's work can't be ended! Because he couldn't get through .KillThe meaning of normal termination!

observation of the program

  1.ps: Capture the program run at a point in time

PS aux <==PS -la <==PS axjf <== together with some program tree status options and Parameters: -A: All process is shown, and-e has the same effect;-A: All process not related to terminal;-u: Effective user (effective user) related The process of x: usually used in conjunction with the A parameter to list more complete information. Output format planning: L: A longer, more detailed list of the PID information; J: Working format (jobs format)-F: Make a more complete output.

  See the Manual for more information : http://linux.51yip.com/search/ps

Usually bird brother will suggest you, directly back two compare different options, one is only to check their own bash program "Ps-l" one is to check all the system running program "PS aux"! Note that you are not mistaken, "PS aux" does not have that minus sign (-)!

  Example:

[Email protected] ~]#PS-EF #显示所有进程的UID, ppip,c and stime field uid PID PPID C stime TTY time Cmdroot1     0  0  -: -?xx:xx:xxinit [3] Root2     1  0  -: -?xx:xx:xx[migration/0]root3     1  0  -: -?xx:xx:xx[ksoftirqd/0]root4     1  0  -: -?xx:xx:xx[watchdog/0]root5     1  0  -: -?xx:xx:xx[migration/1]

 Related Output Field Description:

  F: on behalf of this program flag (process Flags), describes the program's summary permissions, the common number is: if 4indicates that the permission for this program is root; if 1It means that this subroutine is only copied (fork) and not actually executed (exec).  S: represents the status of this program (STAT), the main state is: R (Running): The program is running; S (sleep): The program is currently sleeping (idle), but can be awakened (signal). D: Sleep state that cannot be awakened, usually this program may be waiting for I/O (ex>print)T: Stop status (stop), may be in work control (background pause) or debug (traced) state, Z (Zombie): Zombie status, the program has been terminated but cannot be removed to memory. Uid/pid/ppid: Represents "This program is owned by this UID/program PID number/The Parent program of this program PID number "C: Represents CPU utilization, in percent;pri/ni:priority/   the abbreviation for Nice, which represents the order in which this program is executed by the CPU, the smaller the value represents the The faster the   program is executed by the CPU. The detailed PRI and NI will be explained in the next section.   Addr/sz/wchan: All memory-related, ADDR is kernel function     , indicating which part of the program is in storage, if it is a running program, it will generally show "-"/SZ represents how much memory the program uses/Wchan Indicates whether the program is currently running, the same, if the-
              The c5> indicates that it is running. TTY: The terminal location of the lander, using a dynamic terminal interface for remote login (pts/    N);time: Use off CPU times, note that this program actually spends the CPU running time, not the system time;CMD: is the command abbreviation, What is the directive that caused the triggering procedure for this program? 

 2.top--top: Changes in the dynamic Observer program

5-D to make changes.

  The column name explains:

ordinal column name meaning a PID process IDB PPID parent process IDC ruser Real user named UID process owner The user of the IDE user process Owner's username F Group Process owner name of the "G TTY" boot process terminal. Processes that are not started from the terminal are displayed as?h PR Priority i NI nice value. A negative value represents a high priority, and a positive value indicates the last CPU used by the low-priority J P, which only has meaning in a multi-CPU environment K%CPU time consumed by CPUs last updated to current CPU time total, in seconds per second+ Total CPU time used by the process, Unit 1/100 sec N%the percentage of physical memory used by the MEM process o The total amount of virtual memory used by the VIRT process, in kilobytes. VIRT=swap+The RESp swap process uses the amount of virtual memory that is swapped out, in kilobytes. The size of the physical memory, in kilobytes, that the Q RES process uses and has not been swapped out. RES=code+Datar The physical memory size that the code executable consumes, in parts other than the unit KBS data executable code (data segment+stack) occupies the physical memory size, unit KBT SHR shared memory size, Unit KBU nflt page faults, v NDRT last write to now, number of pages modified. WS process state. D=non-disruptive sleep status R=Run S=Sleep T= Tracking/Stop Z=Zombie Process x command name/command line y Wchan if the process is sleeping, the system function name in sleep is displayed in the Z Flags Task flag, reference sched.h shows only the more important PID, USER, PR, NI, VIRT, RES, SHR, S, %CPU,%MEM, time+, COMMAND columns. You can change the display by using the following shortcut keys:

Linux entry fourth day (bottom)--Program management (supplemental content)

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.