Skip to content

Commit d87b161

Browse files
authored
feat: add prtstat.md (#491)
1 parent c01631b commit d87b161

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

command/prtstat.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
prtstat
2+
===
3+
4+
显示进程信息
5+
6+
## 概要
7+
8+
```shell
9+
prtstat [-r|--raw] pid
10+
prtstat -V|--version
11+
```
12+
13+
## 主要用途
14+
15+
- prtstat打印指定进程的统计信息。这个信息来自/proc/PID/stat文件。
16+
17+
18+
## 参数
19+
20+
-r:以原始(raw)格式打印进程的统计信息
21+
22+
-V: 打印prtstat的版本信息
23+
24+
## 例子
25+
26+
```shell
27+
[root@localhost command]# ps -ef|grep nginx
28+
root 4022 250867 0 16:39 pts/1 00:00:00 grep --color=auto nginx
29+
root 224312 1 0 4月26 ? 00:00:00 nginx: master process /var/openresty/nginx/sbin/nginx
30+
nobody 224313 224312 0 4月26 ? 00:00:00 nginx: worker process
31+
[root@localhost command]# prtstat -r 224312
32+
pid: 224312 comm: nginx
33+
state: S ppid: 1
34+
pgrp: 224312 session: 224312
35+
tty_nr: 0 tpgid: -1
36+
flags: 402040 minflt: 110
37+
cminflt: 0 majflt: 0
38+
cmajflt: 0 utime: 0
39+
stime: 0 cutime: 0
40+
cstime: 0 priority: 20
41+
nice: 0 num_threads: 1
42+
itrealvalue: 0 starttime: 6271470
43+
vsize: 56369152 rss: 413
44+
rsslim: 18446744073709551615 startcode: 4194304
45+
endcode: 5772276 startstack: 140722783765648
46+
kstkesp: 7FFC9389BFB8 kstkeip: 7F25CD42F6C6
47+
wchan: 18446744071885754297 nswap: 0
48+
cnswap: 18446744071885754297 exit_signal: 17
49+
processor: 2 rt_priority: 0
50+
policy: 0 delayaccr_blkio_ticks: 0
51+
guest_time: 0 cguest_time: 0
52+
```
53+
54+
### 注意
55+
56+
1. `prtstat`命令来自于psmisc包。此包来自于base源仓库。
57+
2. psmisc.x86_64 : 用于管理系统上进程的实用程序
58+

0 commit comments

Comments
 (0)