【问题标题】:i want to remove the ram cache but getting permission denied error on ubuntu 18.04.3 Lts 64-bit我想删除 ram 缓存,但在 ubuntu 18.04.3 Lts 64 位上出现权限被拒绝错误
【发布时间】:2020-07-03 10:00:11
【问题描述】:
waseem@waseem-HP-Laptop-14q-cs0xxx:~$ free -h
              total        used        free      shared  buff/cache   available
Mem:           3.7G        1.8G        609M        478M        1.3G        1.2G
Swap:          975M        280M        695M
waseem@waseem-HP-Laptop-14q-cs0xxx:~$ sudo sync; echo 1 > /proc/sys/vm/drop_caches
bash: /proc/sys/vm/drop_caches: Permission denied
waseem@waseem-HP-Laptop-14q-cs0xxx:~$ 

【问题讨论】:

    标签: linux ubuntu-18.04


    【解决方案1】:

    只有 sync 以 sudo 权限运行,而不是 echo。你可以这样做:

    sudo sync; echo 1 | sudo tee /proc/sys/vm/drop_caches >/dev/null
    

    【讨论】:

      猜你喜欢
      • 2020-02-15
      • 2016-06-13
      • 2013-05-25
      • 2015-11-09
      • 1970-01-01
      • 1970-01-01
      • 2014-09-29
      • 2015-05-26
      • 2019-09-15
      相关资源
      最近更新 更多