Linux 我想删除ram缓存,但在ubuntu 18.04.3 Lts 64位上出现权限被拒绝错误

Linux 我想删除ram缓存,但在ubuntu 18.04.3 Lts 64位上出现权限被拒绝错误,linux,ubuntu-18.04,Linux,Ubuntu 18.04,只有sync以sudo权限运行,而不是echo。你可以这样做: 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:

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

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:~$ 
sudo sync; echo 1 | sudo tee /proc/sys/vm/drop_caches >/dev/null