首页 > 资讯 > 数码知识内容详情

pmap命令 - 显示进程的内存映像信息 2024-01-09 09:41:54 网络

pmap命令来自英文词组“process memory map”的缩写,其功能是用于显示进程的内存映像信息。p

pmap命令来自英文词组“process memory map”的缩写,其功能是用于显示进程的内存映像信息。pmap命令能够显示进程映像的起始地址、虚拟内存大小、进程访问地址空间的权限以及内存映像文件等信息,而我们只需告知进程号码即可。

语法格式:pmap [参数] 进程ID

常用参数:

-c 读取默认配置
-d 显示内存映射文件的偏移值、主次设备号等信息
-h 显示帮助信息
-n 创建新的配置
-N 创建新的配置并保存到文件
-p 显示文件的完整路径
-q 静默执行模式
-V 显示版本信息
-x 显示物理内存大小、未同步磁盘页面数量等信息

参考示例

显示进程的内存映像概况:

[root@linuxcool ~]# pmap 1098
1098:   /usr/sbin/sshd -D -oCiphers=aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc,aes128-gcm@openssh.com,aes128-ctr,aes128-cbc -oMACs=hmac-sha2-256-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha1,umac-128@openssh.com,hmac-sha2-512 -oGSSAPIKexAlgorithms=gss-gex-sha1-,gss-group14-sha1- -oKexAlgorithms=curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-
000055e5b8d58000    808K r-x-- sshd
000055e5b9021000     16K r---- sshd
000055e5b9025000      4K rw--- sshd
………………省略部分输出信息………………

显示进程的地址空间等信息:

[root@linuxcool ~]# pmap -x 1098
1098:   /usr/sbin/sshd -D -oCiphers=aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc,aes128-gcm@openssh.com,aes128-ctr,aes128-cbc -oMACs=hmac-sha2-256-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha1,umac-128@openssh.com,hmac-sha2-512 -oGSSAPIKexAlgorithms=gss-gex-sha1-,gss-group14-sha1- -oKexAlgorithms=curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-
Address           Kbytes     RSS   Dirty Mode  Mapping
000055e5b8d58000     808     656       0 r-x-- sshd
000055e5b9021000      16      16      16 r---- sshd
000055e5b9025000       4       4       4 rw--- sshd
………………省略部分输出信息………………

与该功能相关的Linux命令:

  • screen命令 – 多重视窗管理程序
  • poweroff命令 – 关闭操作系统
  • SVGATextMode命令 – 加强文字模式的显示画面
  • logsave命令 – 将输出信息保存到指定的日志文件中
  • lastb命令 – 列出登入系统失败的用户
  • enable命令 – 启动或关闭 shell 内建指令
  • adduser命令 – 创建用户账户
  • anacron命令 – 定期运行命令
  • chrt命令 – 实时管理进程的优先级策略
  • pkill命令 – 依据进程名杀死指定进程

相关标签: 数码科技