Use find
to do a cp
being as root user as shown,
find /proc/cpuinfo -type f -exec cp -iv '{}' /home/dir/ \;
Here is my attempt,
~/cpuinfo$ ls
~/cpuinfo$ sudo find /proc/cpuinfo -type f -exec cp -iv '{}' /home/esunboj/
stackoverflow/cpuinfo/ \;
`/proc/cpuinfo' -> `/home/esunboj/stackoverflow/cpuinfo/cpuinfo'
~/cpuinfo$ ls
cpuinfo
Also, as said /proc
is a pseudo file system meaning the files are not stored on disk but have hooks to kernel. Probably you can read and/or write each entry from user space like a normal file operations. Usually different monitoring programs when they fopen
a file, its now kernel job to find the appropriate driver which handles the task and assign it to that driver. Where in case of /proc
its proc system in the kernel which will read the memory entities with the cost of system load involved.