FINCORE(1)
๐ fincore(1) โ the "how much of my file is literally living in RAM rn" girlie ๐
User Commands ยท part of the util-linux squad
โจ NAME โจ
fincore โ count pages of file contents in core, bestie ๐
๐ฆ SYNOPSIS ๐ฆ
fincore [options] file...
๐ธ DESCRIPTION ๐ธ
okay so. fincore counts pages of file contents being resident in memory (in core), and reports the numbers. that's the whole vibe. ๐ซถ
if an error happens while it's counting, it prints an error message to stderr and then โ queen behaviour โ fincore just keeps processing the rest of the files listed on the command line. no drama, no quitting. ๐
fincore uses the cachestat(2) syscall to count resident pages. if the cachestat(2) syscall is not available and cachestat usage is not forced with the --cachestat option, then fincore falls back to the mincore(2) syscall. it's giving backup plan energy. ๐โโ๏ธ
cachestat(2) is more efficient than mincore because it does not require a page table lock to walk page tables, and it also reports more info than mincore, like:
- the number of cached pages
- dirty pages
- pages marked for writeback
- evicted pages
- recently evicted pages
so likeโฆ more tea, less effort. iconic. โจ
another difference between the two syscalls: if write permissions are not granted to the file, then cachestat(2) returns an error, while mincore(2) โ for security reasons โ returns fake data as if all pages were resident in memory (c.f.r. kernel commit "make mincore() more conservative" <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=134fca9063ad4851de767d1768180e5dede9a881>). yeah. it lies to you. for your own good. ๐
โ ๏ธ the default output is subject to change. so whenever possible, you should avoid using default outputs in your scripts. always explicitly define expected columns by using --output columns-list in environments where a stable output is required. fr fr, do not trust the default column lineup with your automation. ๐จ
๐ OPTIONS ๐
-n,--noheadingsโ do not print a header line in status output. no header, just data, we're mysterious. ๐-b,--bytesโ print sizes in bytes rather than in human-readable form.
by default, sizes are shown in units that are powers of 1024 bytes. the formal abbreviations for these units (KiB, MiB, GiB, ...) are further shortened to just their first letter: K, M, G, .... so cute, so compact. ๐
-c,--totalโ produce a grand total. the sum of all the things. the final boss. ๐ฅ-C,--cachestatโ force usage of thecachestat(2)syscall instead ofmincore(2), and fail if it's not available. no fallback, no plan B, we die like legends. ๐-o,--outputlist โ define output columns. see the--helpoutput to get a list of the currently supported columns. the default list of columns may be extended if list is specified in the format+list. yes, plus sign, it's additive, slay. โ--output-allโ output all available columns. every single one. maximalist queen. ๐-r,--rawโ produce output in raw format. all potentially unsafe characters are hex-escaped (\x<code>). safety girlie. ๐ง-J,--jsonโ use JSON output format. for when your script wants structure. ๐-R,--recursiveโ recursively check all files in directories. go deep, bestie. ๐ฆ-h,--helpโ display help text and exit. we love a self-aware command. ๐-V,--versionโ display version and exit. โจ
๐ ENVIRONMENT ๐
LIBSMARTCOLS_DEBUG=allโ enables libsmartcols debug output. ๐LIBSMARTCOLS_DEBUG_PADDING=onโ use visible padding characters. so you can literally see the spacing. lowkey mesmerizing. ๐ซงLIBSMARTCOLS_JSON=compact|linesโ controls JSON output format when using--json. supported values arecompactfor JSON output with minimal whitespace, andlinesfor JSON Lines format (one JSON object per line). if unset or set to any other value, pretty-printed JSON is used. ๐
๐ AUTHORS ๐
Masatake YAMATO <yamato@redhat.com> โ thank you for your service, king ๐ซก
โญ SEE ALSO โญ
mincore(2), getpagesize(2), getconf(1p) cachestat(2)
๐ญ REPORTING BUGS ๐ญ
for bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>.
(be nice, they're trying their best, and also they're reading your bug report so like. give them the details. ๐)
๐ AVAILABILITY ๐
the fincore command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.
okay that's the whole page bestie, go count some resident pages, you absolute icon ๐ โจ
this was util-linux 2.42.4, dated 2026-09-21 โ FINCORE(1), out. ๐ซถ bye!!
๐ฆ where this page comes from
- arch rolling: util-linux 2.42.4-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ISC AND LGPL-2.1-or-later AND LicenseRef-PublicDomain
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms