summaryrefslogtreecommitdiff
path: root/README.md
blob: c164345ccf6a290624449b800c995c92230ec125 (plain)
1
2
3
4
5
6
7
8
9
# dontneed: tell linux you don't need some files in RAM cache

Maybe used to prevent swapping about files you write but don't read, like somedump.sql.gz on somelog.1.gz.

    Usage: ./dontneed <path>...
     Calls posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED) on each <path>
    
     Tip: you may find all cached files from rootfs with the costly one-liner:
     # find / -mount -type f -print0 | xargs -r0 fincore | grep -vE '^ *0B' | sort -hr | uniq | less