Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I understand everything is a flat file in Linux. How hard is it to dump the contents of the main memory into a flat file? Does it already exist in Linux? If yes, what's the path to the file? What are the default permissions?

share|improve this question
up vote 5 down vote accepted

/dev/mem is probably what you are looking for, this file is manipulated like any other device file with dd and other utilities.

Permissions on my Debian linux system are:

crw-r----- 1 root kmem 1, 1 Aug 21 09:31 mem

share|improve this answer

kcore is (should be) an exact copy of what is running in memory.

cat /proc/kcore

should be readable by everyone.

share|improve this answer
On my system it's -r-------- 1 root root – Michael Mrozek Sep 12 '11 at 13:22
It had better not be readable by anyone but root, since it allows snooping on the memory of every process. /proc/kcore on Linux is readable only by root. Also, /proc/kcore is the kernel's memory mapping; /dev/mem is the physical RAM. – Gilles Sep 13 '11 at 6:47
I see thanks for the information – sethu Sep 14 '11 at 19:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.