A program is a static collection of executable code and data stored on a hard disk.
A process is a computer program that is in a dynamic state of execution on the CPU and in memory.
An application can have multiple processes, and a process can have multiple threads.
Between processes, the use of separate memory space, occupies a large system resources.
Between threads, using shared memory space consumes less system resources.
To view a process:
PS: View the static process statistics.
Parameters:
-A: Show All processes
-A: All processes except the terminal.
-U: Valid user-related processes.
X: Use with A to list more complete information.
Output format:
L: The PID information is listed in detail.
J: The format of the work.
-F: Make a full output.
View your bash-related processes only: Ps-l
Cases:
[Email protected] ~]# ps-l
F S UID PID PPID C PRI NI ADDR SZ Wchan TTY time CMD
4 S 0 2921 2919 0 0-27102 wait pts/0 00:00:00 bash
4 R 0 2961 2921 0 0-27033-pts/0 00:00:00 PS
F: Represents process flags, process permissions, common numbers:
4: Indicates that the permission is root;
1: Indicates that this child process can be replicated only and cannot be actually executed.
S: Represents the status of the process, the main state:
R (Running): The process is running.
S (Sleep): The process is currently asleep, but can be awakened.
D: The sleep state that cannot be awakened, the process may be waiting for I/O situations.
T: The stop state, which may be in the work control (background pause) or the traced state.
Z: Zombie status, the process has been terminated but cannot be deleted out of memory.
Uid/pid/ppid: Represents the parent process PID of this process Pid/this process by which the UID owns the process.
C: Represents CPU usage, in percent.
Pri/ni: Represents the priority that this process is being performed by the CPU, and the smaller the value represents, the faster the process is executed by the CPU.
ADDR: Memory-related, indicates which part of the process in memory-is running.
SZ: How much memory is used to represent this process.
Wchan: Indicates whether the current process is running. -Indicates running.
TTY: terminal location of the user, remote login (dynamic terminal interface)
Time: Used off of the CPU. Is the amount of time this process actually spends running the CPU.
CMD: What is the command that causes this program to trigger a process?
This article is from the "Enron Smile" blog, please be sure to keep this source http://liyuanjie.blog.51cto.com/12877605/1958982
Process and scheduled task management