Skip to main content
clarified the use of $$ and self
Source Link
Gilles 'SO- stop being evil'
  • 865.9k
  • 205
  • 1.8k
  • 2.3k

How do I read from `/proc/$pid/mem`mem under Linux?

The Linux proc(5) man page tells me that /proc/$pid/mem “can be used to access the pages of a process's memory”. But a straightforward attempt to use it only gives me

$ cat /proc/$$/mem /proc/self/mem cat: /proc/3065/mem: No such process cat: /proc/self/mem: Input/output error 

Why didn't these work? How can I read fromisn't cat able to print its own memory (/proc/$pidself/mem)? And what is this strange “no such process” error when I try to print the shell's memory (3065 is/proc/$$/mem, obviously the PID of my shellprocess exists)? How can I read from /proc/$pid/mem, then?

How do I read from `/proc/$pid/mem` under Linux?

The Linux proc(5) man page tells me that /proc/$pid/mem “can be used to access the pages of a process's memory”. But a straightforward attempt to use it only gives me

$ cat /proc/$$/mem /proc/self/mem cat: /proc/3065/mem: No such process cat: /proc/self/mem: Input/output error 

Why didn't these work? How can I read from /proc/$pid/mem? And what is this strange “no such process” error (3065 is the PID of my shell)?

How do I read from /proc/$pid/mem under Linux?

The Linux proc(5) man page tells me that /proc/$pid/mem “can be used to access the pages of a process's memory”. But a straightforward attempt to use it only gives me

$ cat /proc/$$/mem /proc/self/mem cat: /proc/3065/mem: No such process cat: /proc/self/mem: Input/output error 

Why isn't cat able to print its own memory (/proc/self/mem)? And what is this strange “no such process” error when I try to print the shell's memory (/proc/$$/mem, obviously the process exists)? How can I read from /proc/$pid/mem, then?

typo
Source Link
Gilles 'SO- stop being evil'
  • 865.9k
  • 205
  • 1.8k
  • 2.3k

The Linux proc(5) man page tells me that /proc/$pid/mem “can be used to access the pages of a process's memory”. But a straightforward attempt to use it only gives me

$ cat /proc/$$/mem /proc/self/mem cat: /proc/3065/mem: No such process cat: /proc/self/mem: Input/output error 

Why didn't these work? How can I read from /proc/$pid/selfmem? And what is this strange “no such process” error (3065 is the PID of my shell)?

The Linux proc(5) man page tells me that /proc/$pid/mem “can be used to access the pages of a process's memory”. But a straightforward attempt to use it only gives me

$ cat /proc/$$/mem /proc/self/mem cat: /proc/3065/mem: No such process cat: /proc/self/mem: Input/output error 

Why didn't these work? How can I read from /proc/$pid/self? And what is this strange “no such process” error (3065 is the PID of my shell)?

The Linux proc(5) man page tells me that /proc/$pid/mem “can be used to access the pages of a process's memory”. But a straightforward attempt to use it only gives me

$ cat /proc/$$/mem /proc/self/mem cat: /proc/3065/mem: No such process cat: /proc/self/mem: Input/output error 

Why didn't these work? How can I read from /proc/$pid/mem? And what is this strange “no such process” error (3065 is the PID of my shell)?

Tweeted twitter.com/#!/StackUnix/status/29039569965944832
Source Link
Gilles 'SO- stop being evil'
  • 865.9k
  • 205
  • 1.8k
  • 2.3k

How do I read from `/proc/$pid/mem` under Linux?

The Linux proc(5) man page tells me that /proc/$pid/mem “can be used to access the pages of a process's memory”. But a straightforward attempt to use it only gives me

$ cat /proc/$$/mem /proc/self/mem cat: /proc/3065/mem: No such process cat: /proc/self/mem: Input/output error 

Why didn't these work? How can I read from /proc/$pid/self? And what is this strange “no such process” error (3065 is the PID of my shell)?