请帮帮我
没有权限
Linux ns1 2.6.32-042stab123.3 #1 SMP星期五May 5 12:29:05 MSK 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@ns1 /]# whoami
root
[root@ns1 /]# free -h
total used free shared buff/cache available
Mem: 8.0G 720M 124M 128M 7.2G 7.2G
Swap: 0B 0B 0B
[root@ns1 /]# ls -l /proc/sys/vm/drop_caches
-rw-r--r-- 1 root root 0 Apr 26 21:16 /proc/sys/vm/drop_caches
[root@ns1 /]# sync; echo 1 > /proc/sys/vm/drop_caches
bash: /proc/sys/vm/drop_caches: Permission denied
[root@ns1 /]# sudo sh -c 'echo 1 > /proc/sys/vm/drop_caches'
sh: /proc/sys/vm/drop_caches: Permission denied
[root@ns1 /]# sudo sh -c "/usr/bin/echo 1 > /proc/sys/vm/drop_caches"
sh: /proc/sys/vm/drop_caches: Permission denied
[root@ns1 /]# echo 1 | sudo tee /proc/sys/vm/drop_caches
tee: /proc/sys/vm/drop_caches: Permission denied
1
[root@ns1 /]# sudo sync; echo 1 | sudo tee /proc/sys/vm/drop_caches >/dev/null
tee: /proc/sys/vm/drop_caches: Permission denied
[root@ns1 /]# free -m && sync && echo 3 > /proc/sys/vm/drop_caches && free -m
total used free shared buff/cache available
Mem: 8192 696 146 128 7348 7376
Swap: 0 0 0
bash: /proc/sys/vm/drop_caches: Permission denied
试试这个。它正在工作
echo 3 | sudo -i tee /proc/sys/vm/drop_caches