I am trying to copy the whole /
directory to some other location. When doing cp recursively, it fails on some files like:-
/ # ls -lrt /sys/module/nf_conntrack_ipv4/uevent
--w------- 1 root root 4096 Mar 7 06:29 /sys/module/nf_conntrack_ipv4/uevent
/ #
/ # cat /sys/module/nf_conntrack_ipv4/uevent
cat: can't open '/sys/module/nf_conntrack_ipv4/uevent': Permission denied
/ # cp /sys/module/nf_conntrack_ipv4/uevent /tmp
cp: can't open '/sys/module/nf_conntrack_ipv4/uevent': Permission denied
If I create some file with only w
permissions and try to copy/cat it, I could see no problems there. However, for some files like the one mentioned above, I am unable to copy it or to cat it even though I am trying as root user. Also, the strange thing is that the size of the above mentioned file is mentioned to be as 4096 which is similar to the one we have for directory. Is this something special file?
I guess I am missing something here and need some input to know more about such files or such behaviors. Kindly do help me out in understanding why I am not allowed to cat contents of such files.