Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增了prtstat命令,此命令用来查看进程详细信息 #491

Merged
merged 1 commit into from
Apr 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
新增了prtstat命令,此命令用来查看进程详细信息
  • Loading branch information
LinuxZilong committed Apr 27, 2023
commit 019498f7b7ba071d0352c71635afcc65605c4687
58 changes: 58 additions & 0 deletions command/prtstat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
prtstat
===

显示进程信息

## 概要

```shell
prtstat [-r|--raw] pid
prtstat -V|--version
```

## 主要用途

- prtstat打印指定进程的统计信息。这个信息来自/proc/PID/stat文件。


## 参数

-r:以原始(raw)格式打印进程的统计信息

-V: 打印prtstat的版本信息

## 例子

```shell
[root@localhost command]# ps -ef|grep nginx
root 4022 250867 0 16:39 pts/1 00:00:00 grep --color=auto nginx
root 224312 1 0 4月26 ? 00:00:00 nginx: master process /var/openresty/nginx/sbin/nginx
nobody 224313 224312 0 4月26 ? 00:00:00 nginx: worker process
[root@localhost command]# prtstat -r 224312
pid: 224312 comm: nginx
state: S ppid: 1
pgrp: 224312 session: 224312
tty_nr: 0 tpgid: -1
flags: 402040 minflt: 110
cminflt: 0 majflt: 0
cmajflt: 0 utime: 0
stime: 0 cutime: 0
cstime: 0 priority: 20
nice: 0 num_threads: 1
itrealvalue: 0 starttime: 6271470
vsize: 56369152 rss: 413
rsslim: 18446744073709551615 startcode: 4194304
endcode: 5772276 startstack: 140722783765648
kstkesp: 7FFC9389BFB8 kstkeip: 7F25CD42F6C6
wchan: 18446744071885754297 nswap: 0
cnswap: 18446744071885754297 exit_signal: 17
processor: 2 rt_priority: 0
policy: 0 delayaccr_blkio_ticks: 0
guest_time: 0 cguest_time: 0
```

### 注意

1. `prtstat`命令来自于psmisc包。此包来自于base源仓库。
2. psmisc.x86_64 : 用于管理系统上进程的实用程序