Andrew Fletcher published: 31 August 2022 1 minute read
At first, I attempted
echo 1 > /proc/sys/vm/drop_caches
Response
-bash: /proc/sys/vm/drop_caches: Permission denied
Adding sudo in front of the command was met with the same result. What about if I execute the shell as root
sudo sh -c 'echo 1 > /proc/sys/vm/drop_caches'
Success. Caches cleared.
Different types of clearing cache
Clear PageCache only
sudo sh -c 'echo 1 > /proc/sys/vm/drop_caches'
Clear dentries and inodes
sudo sh -c 'echo 2 > /proc/sys/vm/drop_caches'
Clear pagecache, dentries, and inodes
sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'
Related articles
Andrew Fletcher
•
18 Apr 2024
No results showing for your Solr instance - solr.service: Failed with result 'exit-code'
When Solr is displaying results on the site, first step is to log in the server and check its status● solr.service - LSB: Controls Apache Solr as a Service
Loaded: loaded (/etc/init.d/solr; generated)
Active: failed (Result: exit-code) since Wed 2024-04-17 23:22:52 UTC; 6h ago
...
Andrew Fletcher
•
18 Mar 2024
Resolving CVE-2022-48624 less issue
To resolve the CVE-2022-48624 vulnerability on Ubuntu using Nginx, it's crucial to understand that the issue lies within the "less" package, not Nginx itself. The vulnerability affects "less" before version 606, where close_altfile in filename.c in less omits shell_quote calls for LESSCLOSE,...
Andrew Fletcher
•
06 Mar 2024
Terminal command to find and replace
In many terminal text editors, you use find command as reference in Terminal commands - find. How about find and replace. This action depends on the specific text editor you're using in the terminal. Here are a few common terminal text editors and how you can find and replace...