Linux information about running processes-general Linux technology-Linux programming and kernel information. For more information, see the following section. The/proc file system can be used to obtain information about running processes. There are some numbered subdirectories in/proc. Each numbered directory corresponds to a process id (PID ). In this way, each running process/proc has a directory named after its PID. These subdirectories contain files that provide important details about the process status and environment. Let's try to find a running process.
The preceding command shows that the PID of a running mozilla process is 32558. Correspondingly,/proc should have a directory named 32558
The command above uses Ps to obtain information about all processes. Enter grep in the pipeline. Use the grep command to obtain information about mozilla processes. The PS command is described as follows:
Ps
1. Role
Ps displays the dynamics of the instantaneous process. The permission is applied to all users.
2. Format
Ps [options] [-- help]
3. Main Parameters
There are many ps parameters. Only a few common parameters are listed here.
-A: List all processes.
-L: displays the long list.
-M: displays memory information.
-W: Display widening can display more information.
-E: displays all processes.
A: displays all processes on the terminal, including those of other users.
-Au: displays more detailed information.
-Aux: displays all processes that contain other users.
4. Description
To monitor and control processes, you must first understand the current process, that is, you need to view the current process. Ps command is the most basic and powerful process view command. You can use this command to determine which processes are running, the running status, whether the processes are finished, whether the processes are botnets, and which processes are occupying excessive resources. The ps-aux command is described in detail. Most of the information can be obtained by executing this command. The three most common parameters are u, a, and x. The following three parameters are used to describe the role of the ps command: ps aux
STAT indicates the state of the process, where D is the static state that cannot be interrupted (I/O action); R is being executed; S is static; T is paused; Z does not exist, but it cannot be eliminated for the time being; W does not have enough memory to be allocated by page; high-priority processes; N low-priority processes; L memory is allocated by PAGE and locked in the memory (real-time system or I/O ). START indicates the process START time. TIME indicates the execution TIME. COMMAND is the executed COMMAND.
4. Application Instance
During system maintenance, the memory usage is often astonishing, but you do not know which process occupies a large number of processes. In addition to using the top command to view memory usage, you can also use the following command:
Ps aux | sort + 5n
$ Ls-l/proc/32558
Total 0
-R -- 1 root 0 Dec 25 offline line
-R -- 1 root 0 Dec 25 22:59 cpu
Lrwxrwxrwx 1 root 0 Dec 25 22:59 cwd->/proc/
-R -------- 1 root 0 Dec 25 22: 59 environ
Lrwxrwxrwx 1 root 0 Dec 25 exe->/usr/bin/mozilla *
Dr-x ------ 2 root 0 Dec 25 22:59 fd/
-R -- 1 root 0 Dec 25 22:59 maps
-Rw ------- 1 root 0 Dec 25 22:59 mem
-R -- 1 root 0 Dec 25 22:59 mounts
Lrwxrwxrwx 1 root 0 Dec 25 root-> //
-R -- 1 root 0 Dec 25 22:59 stat
-R -- 1 root 0 Dec 25 22:59 statm
-R -- 1 root 0 Dec 25 22:59 status
The "cmdline" file contains the command line called when the process is started. The environment of the "envir" process is changed to two. "Status" indicates the status of a process, including the user ID (UID), group ID (GID), parent process ID (PPID), and current status of the process, for example, "Sleelping" and "Running ". Each process directory has several symbolic links. "cwd" is a symbolic link pointing to the current working directory of the process. "exe" points to the executable program of the running process, "root" points to the directory (usually "/") of the root directory "/"). The directory "fd" contains a link to the file descriptor used by the process. "Cpu" only appears when running the SMP kernel, which is the process time by CPU. /Proc/self is an interesting sub-Directory, which allows the program to conveniently use/proc to find information about the local process. /Proc/self is a symbolic link to the PID directory of the process accessing/proc in/proc.
The above is a supplement to/proc. As you can see, this is only a small knowledge point on outline and involves so much content. I think this is probably the reason why Linux is hard to learn.
Note: vmware server 1.0.3 is installed on both the Unit and the home machine for Linux. However, this software is not very stable. At present, the one in the house is unable to run Fedora 7. There is no boot screen for vmware. If you run F7, it is a black screen.
It seems that only the computer has been reinstalled this evening. This is also the cost of learning. -_-B has not been reinstalled for two years. Even xianjian 4.
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.