I am trying to edit the file /proc/sys/vm/overcommit_memory
, but I'm getting permission denied even if I use sudo
or switch to root user via sudo -i
and try to edit using that account. How can I get this to work?
I am trying to edit the file /proc/sys/vm/overcommit_memory
, but I'm getting permission denied even if I use sudo
or switch to root user via sudo -i
and try to edit using that account. How can I get this to work?
Instead of using
sudo -i
and then usingecho
, just pipeecho
tosudo tee
instead like this:I found my answer here. I was trying to use vim to edit the file while in root user mode, but it turns out you can't do that since the file is virtual. Instead, I used
echo 1 >/proc/sys/vm/overcommit_memory