/proc directory stored in a RAM or Hard drive?

Multi tool use
I want to know what is the /proc and what kind of stuffs included in that? And if the /proc store in RAM or Hard drive?
Thanks
proc
add a comment |
I want to know what is the /proc and what kind of stuffs included in that? And if the /proc store in RAM or Hard drive?
Thanks
proc
add a comment |
I want to know what is the /proc and what kind of stuffs included in that? And if the /proc store in RAM or Hard drive?
Thanks
proc
I want to know what is the /proc and what kind of stuffs included in that? And if the /proc store in RAM or Hard drive?
Thanks
proc
proc
asked Jan 23 at 8:06


fedorafedora
225
225
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Taken from here:
/proc is very special in that it is also a virtual filesystem. It's sometimes referred to as a process information pseudo-file system. It doesn't contain 'real' files but runtime system information (e.g. system memory, devices mounted, hardware configuration, etc).
again, from the same site:
The /proc filesystem contains a illusionary filesystem. It does not exist on a disk. Instead, the kernel creates it in memory.
So, to answer your questions:
/proc
contains information about your system and peripherals, it can also be used to control kernel behaviour by writing to it. Details about the content of each entry can be found at the first link.
For example, you can get your CPU information by inspecting/proc/cpuinfo
:
cat /proc/cpuinfo
Or you can change options like IP forwarding:
echo "1" > /proc/sys/net/ipv4/ip_forward # enables IP forwading
echo "0" > /proc/sys/net/ipv4/ip_forward # disables IP forwading
It's not a real filesystem. It is a representation of the kernel inner structures. So, it's not really stored anywhere, but you can say that its contents are stored in the kernel memory (so "RAM").
Most of the operations you can perform directly on the /proc
filesystem can (and really, should) be performed via the sysctl
utility (manpage).
1
Technically, I wouldn't say its "contents" are stored anywhere. Some of it is almost certainly generated on-the-fly when the corresponding file is accessed. IIRC some file is indeed a representation of memory as the kernel sees it (and hence can't be stored in memory).
– Olorin
Jan 23 at 8:35
1
@Olorin yeah, the second point is not clear. I'm going to elaborate on that soon. Thank you.
– Mr Shunz
Jan 23 at 8:37
Yes, that's much clearer. Suggestion: link to Ubuntu manpages.ubuntu.com or Debian manpages.debian.org so that it's easier to look up version-specific manpages (e.g, compare linux.die.net/man/8/sysctl with manpages.debian.org/jessie/procps/sysctl.8.en.html or manpages.ubuntu.com/manpages/bionic/en/man8/sysctl.8.html )
– Olorin
Jan 23 at 8:49
1
@Olorin fixed manpage link.
– Mr Shunz
Jan 23 at 9:03
add a comment |
To quote kernel.org documentation :
The proc file system acts as an interface to internal data structures in the kernel. It can be used to obtain information about the system and to change
certain kernel parameters at runtime (sysctl).
Kernel itself is loaded in memory. Along with sockfs
and pipefs
, procfs
is a virtual filesystem. The directory /proc
you see on the disk is not permanent - data in this directory remains there only for the duration of the system running. Once you shut it down, the data does not remain on disk and the directory will be empty. The directory itself merely serves as mountpoint for in-kernel filesystem.
As for information that it contains, the Wikipedia article on procfs describes it succinctly:
The proc filesystem (procfs) is a special filesystem in Unix-like operating systems that presents information about processes and other system information in a hierarchical file-like structure, providing a more convenient and standardized method for dynamically accessing process data held in the kernel than traditional tracing methods or direct access to kernel memory.
...
The proc filesystem provides a method of communication between kernel space and user space. For example, the GNU version of the process reporting utility ps uses the proc file system to obtain its data, without using any specialized system calls.
Among other things, it's a convenient method for processes to know what resources are available to them. For instance, if you run strace -e open,openat df
you will see that it opens /proc/self/mountinfo
to obtain information about mountpoints available to it running under your username:
openat(AT_FDCWD, "/proc/self/mountinfo", O_RDONLY) = 3
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112177%2fproc-directory-stored-in-a-ram-or-hard-drive%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Taken from here:
/proc is very special in that it is also a virtual filesystem. It's sometimes referred to as a process information pseudo-file system. It doesn't contain 'real' files but runtime system information (e.g. system memory, devices mounted, hardware configuration, etc).
again, from the same site:
The /proc filesystem contains a illusionary filesystem. It does not exist on a disk. Instead, the kernel creates it in memory.
So, to answer your questions:
/proc
contains information about your system and peripherals, it can also be used to control kernel behaviour by writing to it. Details about the content of each entry can be found at the first link.
For example, you can get your CPU information by inspecting/proc/cpuinfo
:
cat /proc/cpuinfo
Or you can change options like IP forwarding:
echo "1" > /proc/sys/net/ipv4/ip_forward # enables IP forwading
echo "0" > /proc/sys/net/ipv4/ip_forward # disables IP forwading
It's not a real filesystem. It is a representation of the kernel inner structures. So, it's not really stored anywhere, but you can say that its contents are stored in the kernel memory (so "RAM").
Most of the operations you can perform directly on the /proc
filesystem can (and really, should) be performed via the sysctl
utility (manpage).
1
Technically, I wouldn't say its "contents" are stored anywhere. Some of it is almost certainly generated on-the-fly when the corresponding file is accessed. IIRC some file is indeed a representation of memory as the kernel sees it (and hence can't be stored in memory).
– Olorin
Jan 23 at 8:35
1
@Olorin yeah, the second point is not clear. I'm going to elaborate on that soon. Thank you.
– Mr Shunz
Jan 23 at 8:37
Yes, that's much clearer. Suggestion: link to Ubuntu manpages.ubuntu.com or Debian manpages.debian.org so that it's easier to look up version-specific manpages (e.g, compare linux.die.net/man/8/sysctl with manpages.debian.org/jessie/procps/sysctl.8.en.html or manpages.ubuntu.com/manpages/bionic/en/man8/sysctl.8.html )
– Olorin
Jan 23 at 8:49
1
@Olorin fixed manpage link.
– Mr Shunz
Jan 23 at 9:03
add a comment |
Taken from here:
/proc is very special in that it is also a virtual filesystem. It's sometimes referred to as a process information pseudo-file system. It doesn't contain 'real' files but runtime system information (e.g. system memory, devices mounted, hardware configuration, etc).
again, from the same site:
The /proc filesystem contains a illusionary filesystem. It does not exist on a disk. Instead, the kernel creates it in memory.
So, to answer your questions:
/proc
contains information about your system and peripherals, it can also be used to control kernel behaviour by writing to it. Details about the content of each entry can be found at the first link.
For example, you can get your CPU information by inspecting/proc/cpuinfo
:
cat /proc/cpuinfo
Or you can change options like IP forwarding:
echo "1" > /proc/sys/net/ipv4/ip_forward # enables IP forwading
echo "0" > /proc/sys/net/ipv4/ip_forward # disables IP forwading
It's not a real filesystem. It is a representation of the kernel inner structures. So, it's not really stored anywhere, but you can say that its contents are stored in the kernel memory (so "RAM").
Most of the operations you can perform directly on the /proc
filesystem can (and really, should) be performed via the sysctl
utility (manpage).
1
Technically, I wouldn't say its "contents" are stored anywhere. Some of it is almost certainly generated on-the-fly when the corresponding file is accessed. IIRC some file is indeed a representation of memory as the kernel sees it (and hence can't be stored in memory).
– Olorin
Jan 23 at 8:35
1
@Olorin yeah, the second point is not clear. I'm going to elaborate on that soon. Thank you.
– Mr Shunz
Jan 23 at 8:37
Yes, that's much clearer. Suggestion: link to Ubuntu manpages.ubuntu.com or Debian manpages.debian.org so that it's easier to look up version-specific manpages (e.g, compare linux.die.net/man/8/sysctl with manpages.debian.org/jessie/procps/sysctl.8.en.html or manpages.ubuntu.com/manpages/bionic/en/man8/sysctl.8.html )
– Olorin
Jan 23 at 8:49
1
@Olorin fixed manpage link.
– Mr Shunz
Jan 23 at 9:03
add a comment |
Taken from here:
/proc is very special in that it is also a virtual filesystem. It's sometimes referred to as a process information pseudo-file system. It doesn't contain 'real' files but runtime system information (e.g. system memory, devices mounted, hardware configuration, etc).
again, from the same site:
The /proc filesystem contains a illusionary filesystem. It does not exist on a disk. Instead, the kernel creates it in memory.
So, to answer your questions:
/proc
contains information about your system and peripherals, it can also be used to control kernel behaviour by writing to it. Details about the content of each entry can be found at the first link.
For example, you can get your CPU information by inspecting/proc/cpuinfo
:
cat /proc/cpuinfo
Or you can change options like IP forwarding:
echo "1" > /proc/sys/net/ipv4/ip_forward # enables IP forwading
echo "0" > /proc/sys/net/ipv4/ip_forward # disables IP forwading
It's not a real filesystem. It is a representation of the kernel inner structures. So, it's not really stored anywhere, but you can say that its contents are stored in the kernel memory (so "RAM").
Most of the operations you can perform directly on the /proc
filesystem can (and really, should) be performed via the sysctl
utility (manpage).
Taken from here:
/proc is very special in that it is also a virtual filesystem. It's sometimes referred to as a process information pseudo-file system. It doesn't contain 'real' files but runtime system information (e.g. system memory, devices mounted, hardware configuration, etc).
again, from the same site:
The /proc filesystem contains a illusionary filesystem. It does not exist on a disk. Instead, the kernel creates it in memory.
So, to answer your questions:
/proc
contains information about your system and peripherals, it can also be used to control kernel behaviour by writing to it. Details about the content of each entry can be found at the first link.
For example, you can get your CPU information by inspecting/proc/cpuinfo
:
cat /proc/cpuinfo
Or you can change options like IP forwarding:
echo "1" > /proc/sys/net/ipv4/ip_forward # enables IP forwading
echo "0" > /proc/sys/net/ipv4/ip_forward # disables IP forwading
It's not a real filesystem. It is a representation of the kernel inner structures. So, it's not really stored anywhere, but you can say that its contents are stored in the kernel memory (so "RAM").
Most of the operations you can perform directly on the /proc
filesystem can (and really, should) be performed via the sysctl
utility (manpage).
edited Jan 23 at 9:03
answered Jan 23 at 8:32
Mr ShunzMr Shunz
2,49121922
2,49121922
1
Technically, I wouldn't say its "contents" are stored anywhere. Some of it is almost certainly generated on-the-fly when the corresponding file is accessed. IIRC some file is indeed a representation of memory as the kernel sees it (and hence can't be stored in memory).
– Olorin
Jan 23 at 8:35
1
@Olorin yeah, the second point is not clear. I'm going to elaborate on that soon. Thank you.
– Mr Shunz
Jan 23 at 8:37
Yes, that's much clearer. Suggestion: link to Ubuntu manpages.ubuntu.com or Debian manpages.debian.org so that it's easier to look up version-specific manpages (e.g, compare linux.die.net/man/8/sysctl with manpages.debian.org/jessie/procps/sysctl.8.en.html or manpages.ubuntu.com/manpages/bionic/en/man8/sysctl.8.html )
– Olorin
Jan 23 at 8:49
1
@Olorin fixed manpage link.
– Mr Shunz
Jan 23 at 9:03
add a comment |
1
Technically, I wouldn't say its "contents" are stored anywhere. Some of it is almost certainly generated on-the-fly when the corresponding file is accessed. IIRC some file is indeed a representation of memory as the kernel sees it (and hence can't be stored in memory).
– Olorin
Jan 23 at 8:35
1
@Olorin yeah, the second point is not clear. I'm going to elaborate on that soon. Thank you.
– Mr Shunz
Jan 23 at 8:37
Yes, that's much clearer. Suggestion: link to Ubuntu manpages.ubuntu.com or Debian manpages.debian.org so that it's easier to look up version-specific manpages (e.g, compare linux.die.net/man/8/sysctl with manpages.debian.org/jessie/procps/sysctl.8.en.html or manpages.ubuntu.com/manpages/bionic/en/man8/sysctl.8.html )
– Olorin
Jan 23 at 8:49
1
@Olorin fixed manpage link.
– Mr Shunz
Jan 23 at 9:03
1
1
Technically, I wouldn't say its "contents" are stored anywhere. Some of it is almost certainly generated on-the-fly when the corresponding file is accessed. IIRC some file is indeed a representation of memory as the kernel sees it (and hence can't be stored in memory).
– Olorin
Jan 23 at 8:35
Technically, I wouldn't say its "contents" are stored anywhere. Some of it is almost certainly generated on-the-fly when the corresponding file is accessed. IIRC some file is indeed a representation of memory as the kernel sees it (and hence can't be stored in memory).
– Olorin
Jan 23 at 8:35
1
1
@Olorin yeah, the second point is not clear. I'm going to elaborate on that soon. Thank you.
– Mr Shunz
Jan 23 at 8:37
@Olorin yeah, the second point is not clear. I'm going to elaborate on that soon. Thank you.
– Mr Shunz
Jan 23 at 8:37
Yes, that's much clearer. Suggestion: link to Ubuntu manpages.ubuntu.com or Debian manpages.debian.org so that it's easier to look up version-specific manpages (e.g, compare linux.die.net/man/8/sysctl with manpages.debian.org/jessie/procps/sysctl.8.en.html or manpages.ubuntu.com/manpages/bionic/en/man8/sysctl.8.html )
– Olorin
Jan 23 at 8:49
Yes, that's much clearer. Suggestion: link to Ubuntu manpages.ubuntu.com or Debian manpages.debian.org so that it's easier to look up version-specific manpages (e.g, compare linux.die.net/man/8/sysctl with manpages.debian.org/jessie/procps/sysctl.8.en.html or manpages.ubuntu.com/manpages/bionic/en/man8/sysctl.8.html )
– Olorin
Jan 23 at 8:49
1
1
@Olorin fixed manpage link.
– Mr Shunz
Jan 23 at 9:03
@Olorin fixed manpage link.
– Mr Shunz
Jan 23 at 9:03
add a comment |
To quote kernel.org documentation :
The proc file system acts as an interface to internal data structures in the kernel. It can be used to obtain information about the system and to change
certain kernel parameters at runtime (sysctl).
Kernel itself is loaded in memory. Along with sockfs
and pipefs
, procfs
is a virtual filesystem. The directory /proc
you see on the disk is not permanent - data in this directory remains there only for the duration of the system running. Once you shut it down, the data does not remain on disk and the directory will be empty. The directory itself merely serves as mountpoint for in-kernel filesystem.
As for information that it contains, the Wikipedia article on procfs describes it succinctly:
The proc filesystem (procfs) is a special filesystem in Unix-like operating systems that presents information about processes and other system information in a hierarchical file-like structure, providing a more convenient and standardized method for dynamically accessing process data held in the kernel than traditional tracing methods or direct access to kernel memory.
...
The proc filesystem provides a method of communication between kernel space and user space. For example, the GNU version of the process reporting utility ps uses the proc file system to obtain its data, without using any specialized system calls.
Among other things, it's a convenient method for processes to know what resources are available to them. For instance, if you run strace -e open,openat df
you will see that it opens /proc/self/mountinfo
to obtain information about mountpoints available to it running under your username:
openat(AT_FDCWD, "/proc/self/mountinfo", O_RDONLY) = 3
add a comment |
To quote kernel.org documentation :
The proc file system acts as an interface to internal data structures in the kernel. It can be used to obtain information about the system and to change
certain kernel parameters at runtime (sysctl).
Kernel itself is loaded in memory. Along with sockfs
and pipefs
, procfs
is a virtual filesystem. The directory /proc
you see on the disk is not permanent - data in this directory remains there only for the duration of the system running. Once you shut it down, the data does not remain on disk and the directory will be empty. The directory itself merely serves as mountpoint for in-kernel filesystem.
As for information that it contains, the Wikipedia article on procfs describes it succinctly:
The proc filesystem (procfs) is a special filesystem in Unix-like operating systems that presents information about processes and other system information in a hierarchical file-like structure, providing a more convenient and standardized method for dynamically accessing process data held in the kernel than traditional tracing methods or direct access to kernel memory.
...
The proc filesystem provides a method of communication between kernel space and user space. For example, the GNU version of the process reporting utility ps uses the proc file system to obtain its data, without using any specialized system calls.
Among other things, it's a convenient method for processes to know what resources are available to them. For instance, if you run strace -e open,openat df
you will see that it opens /proc/self/mountinfo
to obtain information about mountpoints available to it running under your username:
openat(AT_FDCWD, "/proc/self/mountinfo", O_RDONLY) = 3
add a comment |
To quote kernel.org documentation :
The proc file system acts as an interface to internal data structures in the kernel. It can be used to obtain information about the system and to change
certain kernel parameters at runtime (sysctl).
Kernel itself is loaded in memory. Along with sockfs
and pipefs
, procfs
is a virtual filesystem. The directory /proc
you see on the disk is not permanent - data in this directory remains there only for the duration of the system running. Once you shut it down, the data does not remain on disk and the directory will be empty. The directory itself merely serves as mountpoint for in-kernel filesystem.
As for information that it contains, the Wikipedia article on procfs describes it succinctly:
The proc filesystem (procfs) is a special filesystem in Unix-like operating systems that presents information about processes and other system information in a hierarchical file-like structure, providing a more convenient and standardized method for dynamically accessing process data held in the kernel than traditional tracing methods or direct access to kernel memory.
...
The proc filesystem provides a method of communication between kernel space and user space. For example, the GNU version of the process reporting utility ps uses the proc file system to obtain its data, without using any specialized system calls.
Among other things, it's a convenient method for processes to know what resources are available to them. For instance, if you run strace -e open,openat df
you will see that it opens /proc/self/mountinfo
to obtain information about mountpoints available to it running under your username:
openat(AT_FDCWD, "/proc/self/mountinfo", O_RDONLY) = 3
To quote kernel.org documentation :
The proc file system acts as an interface to internal data structures in the kernel. It can be used to obtain information about the system and to change
certain kernel parameters at runtime (sysctl).
Kernel itself is loaded in memory. Along with sockfs
and pipefs
, procfs
is a virtual filesystem. The directory /proc
you see on the disk is not permanent - data in this directory remains there only for the duration of the system running. Once you shut it down, the data does not remain on disk and the directory will be empty. The directory itself merely serves as mountpoint for in-kernel filesystem.
As for information that it contains, the Wikipedia article on procfs describes it succinctly:
The proc filesystem (procfs) is a special filesystem in Unix-like operating systems that presents information about processes and other system information in a hierarchical file-like structure, providing a more convenient and standardized method for dynamically accessing process data held in the kernel than traditional tracing methods or direct access to kernel memory.
...
The proc filesystem provides a method of communication between kernel space and user space. For example, the GNU version of the process reporting utility ps uses the proc file system to obtain its data, without using any specialized system calls.
Among other things, it's a convenient method for processes to know what resources are available to them. For instance, if you run strace -e open,openat df
you will see that it opens /proc/self/mountinfo
to obtain information about mountpoints available to it running under your username:
openat(AT_FDCWD, "/proc/self/mountinfo", O_RDONLY) = 3
edited Jan 23 at 9:04
answered Jan 23 at 8:53


Sergiy KolodyazhnyySergiy Kolodyazhnyy
72.9k9152316
72.9k9152316
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112177%2fproc-directory-stored-in-a-ram-or-hard-drive%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
WbfpbgWR,qvBZn4Ju5,4wlqhRDLNk2vp5ElW,YMCc2jI2Hi6X5BIwXGcFkk9 DaB stRiXAD A4dayz,1Mec yRvx 4H,K,P