Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bash: /proc/sys/vm/drop_caches: Permission denied

$ echo 3 > /proc/sys/vm/drop_caches
bash: /proc/sys/vm/drop_caches: Permission denied

Tried with the system password. But still failing.

like image 438
Janz Avatar asked Dec 10 '22 00:12

Janz


1 Answers

Execute the shell as root:

sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'

Or redirect the input to a process that will write to file as root:

echo 3 | sudo tee /proc/sys/vm/drop_caches
like image 174
KamilCuk Avatar answered Dec 12 '22 15:12

KamilCuk