As the question says, I need to edit my /proc/acpi/wakeup
file, but when I open it with any text editor, it shows blank file. cat
command, on the other hand, displays correct file contents in terminal. When I navigate to that file in file manager, it says it's size is 0 bytes. I'm using Xubuntu 15.04. I'm thoroughly confused.
/proc
(manpage, kernel docs) is a virtual filesystem (as is/sys
- kernel docs). Files in/proc
aren't real files, but ways to access information and settings from the kernel. You shouldn't use an editor to edit files in/proc
, but write directly to these files:When you attempt to read or write from it, the kernel converts the actions to system calls internally and does the right thing. Some editors can still view the contents (try Vim, for example), but writing to it is a different story.
For a special class of files, those in
/proc/sys
(kernel docs, Arch Wiki), there's another alternative. You can use the configuration files in/etc/sysctl.conf
and/etc/sysctl.d/*.conf
to make permanent changes to their values. A file/proc/sys/foo/bar
can be set using a keyfoo.bar
in one of these files.For example,
/proc/sys/vm/swappiness
can be set by adding a/etc/sysctl.d/90-swappiness.conf
containing:And running:
You can also make one-off changes (that won't survive the next reboot) by using the
sysctl
command directly: