lostfiles(1)

πŸ“¦ version 5.1, in arch rolling

✨ lostfiles ✨

okay bestie, so this is lostfiles(1) β€” the little detective that finds files on your system that literally no package owns. no cap, it's a whole vibe. πŸ•΅οΈβ€β™€οΈπŸ’…


πŸ’– NAME πŸ’–

lostfiles β€” finds orphaned files that aren't owned by any packages. like, these files are out here with no parents, no package, no nothing. main character files with zero supervision 😭


πŸŽ€ USAGE πŸŽ€

lostfiles [-s] [-z] [-h]

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea, bestie: lostfiles takes pacman's database of package-owned files and compares it against what's actually on your filesystem, then reports every file that no package claims. it's giving "who are you and why are you in my house" energy. super useful for spotting non-native files chilling on your system. 🌸

⚠️ heads up: you have to run this as root. no root, no report, periodt.

πŸ”₯ OPTIONS πŸ”₯

  • -s β€” strict mode! this one aims to be more verbose and ignores less. highkey the "trust nothing, report everything" setting πŸ‘‘
  • -z β€” prints and sorts by the size of matches. so you can see which orphan is the biggest snack πŸ“
  • -h β€” displays usage info and dips out. iconic, honestly ✨

πŸ’œ USER-DEFINED EXCLUDES πŸ’œ

lostfiles.conf is customizable with a list of paths to include and exclude when you're running in relaxed mode. here's how the rules work, so listen up 🎧:

  • each line starts with either a plus (+) or a minus (-) sign, followed by an absolute path β€” + includes that path in the results, - excludes it. simple as that bestie πŸ’…
  • exclude paths are matched as shell-style globs: an asterisk (*) matches any string within a single path component, and a double asterisk (**) matches across directory separators.
  • excluding a directory prunes its entire subtree. one rule, whole vibe gone 🌈
  • lines beginning with a number sign (#) are interpreted as comments. very demure, very mindful.
  • any other line makes lostfiles abort with an error β€” this is on purpose, so that a malformed rule is never silently ignored. ngl that's the correct energy 🫢

Now, about where it looks first: lostfiles looks for a lostfiles.conf next to the script itself. but if that file is missing, or if it (or its containing directory) is not owned by root or the invoking sudo user, or it's writable by group or other β€” it gets ignored with a warning and lostfiles falls back to /etc/lostfiles.conf instead. why?? because this prevents a loosely-permissioned configuration file from being used to hide files from the report. πŸ’€ literally security girlboss behavior.

Additional configuration overrides can go in /etc/lostfiles.d/ as individual *.conf files. these drop-in files use the same format as /etc/lostfiles.conf and are read in lexical order after the main configuration file. this lets packages or local admins add custom include/exclude rules without touching the main configuration file. chef's kiss, no notes πŸ‘©β€πŸ³


🧚 NOTES 🧚

File names containing a literal newline are dropped from the results and reported in a summary warning on stderr, rather than being printed β€” because a crafted file name could otherwise inject a spoofed line into the report. yeah. scary. we do not let the files lie to us πŸ™ˆ

lostfiles requires fd, pacman, and a handful of standard coreutils/base tools to be present. it refuses to run and lists whatever is missing rather than silently producing an incomplete report. no half-finished report shenanigans in this house 🚫


⭐ CONTRIBUTE ⭐

Users wishing to contribute to this code should fork and send a pull request. source is freely available at:


🌸 AUTHORS 🌸

Current maintainer:

  • graysky <therealgraysky AT proton DOT me>

Past major contributors:

  • Joan Bruguera (joanbrugueram AT gmail DOT com)
  • Mircea Bardac (dev AT mircea.bardac.net)
  • Modified by Jan Janssen, graysky, karol, asdffdsa, iceram, and others.

okay that's the whole page, bestie!! 🫢 this lil manual page dropped on 12 July 2026, and yeah β€” it's lostfiles(1), page and all, living its best life. go find those orphans, slay, and remember: run it as root πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from