how to clear cache in ubuntu code example

Example 1: linux memory cache clear

# clear pagecache only.
sync; echo 1 > /proc/sys/vm/drop_caches

# clear dentries and inodes.
sync; echo 2 > /proc/sys/vm/drop_caches

# clear pagecache, dentries and inodes.
sync; echo 3 > /proc/sys/vm/drop_caches

Example 2: remove all cache ubuntu

$ sudo apt-get clean

Example 3: how to clear all the caches in ubuntu

sudo apt-get clean

Example 4: delete cash on ubuntu

//delete cash  //
systemd-resolve --statistics
systemd-resolve --flush-caches

Example 5: how to clear memory in ubuntu 18.04

sync; echo 1 > /proc/sys/vm/drop_caches

Tags:

Css Example