fatrace(8)
πΈ NAME πΈ
okay so this is the System Manager's Manual page (section 8) for fatrace π
β the tool that reports system wide file access events. that's it, that's the whole job, and it eats. π₯
β¨ SYNOPSIS β¨
fatrace [ OPTIONS ]
π¦ DESCRIPTION π¦
bestie. fatrace reports file access events from all running processes. every single one. no cap. π
two things it deliberately does not do, and this is on purpose:
- It does not report file access by
fatraceitself, because that would mean logging the events caused by writing its own output into a file, and we are not doing feedback loops today π - It also ignores events on virtual and kernel file systems such as
sysfs,proc, anddevtmpfs.
Its main purpose is to find processes which keep waking up the disk unnecessarily and thus prevent some power saving. it's the "who is spinning up my disk at 3am" detective π΅οΈ and honestly? iconic.
By default, events are reported to stdout. β οΈ heads up though: this will cause some loops if you run this tool in e. g. gnome-terminal, as this causes a disk access for every output line. To avoid this, redirect the output into a file. periodt.
π OUTPUT FORMAT π
There are two output formats. The default text format is easier on human eyes, while the JSONL format is more suitable for automatic processing. pick your fighter π
π text format
a typical event looks like
rsyslogd(875): W /var/log/auth.log
compiz(1971): O device 8:2 inode 658203
In text format, the line has the following fields:
- The current time, if you specify the
--timestampoption. - Process name. This is read from
/proc/pid/comm, which might be abbreviated for long process names. - Process ID
- UID and GID, if you specify the
--useroption. It is formatted as"[uid:gid]". - Event type: Open, Read, Write, Close. Events on directories are
+(create), Delete,<(moved from), or>(moved to). Combinations are possible, such asCWfor closing a written file, or<>for renaming a file within the same directory.
Directory events can only be detected on Linux 5.1 or higher.
- Affected file. In some cases the path and name cannot be determined, e. g. because it is a temporary file which is already deleted. In that case, it prints the devices' major and minor number and the inode number. To examine such a process in more detail, you should consider using
strace(1). - Path to executable, if you specify the
--exeoption. This is read from/proc/pid/exe. - Parent process information, if you specify the
--parentsoption. This information includes, for each successive parent process, the process ID, the process name, and the executable path if you specify the--exeoption. Iffatracefails to determine some of this information, fields may be missing or the list may end before the process with ID 1.
π§Ύ JSONL format
the line is a JSON-encoded object with the following fields:
timestampβ The current time, if you specify the--timestampoption.commβ Process name. This is read from/proc/pid/comm, which might be abbreviated for long process names.comm_rawβ The raw bytes of the process name, in case it is invalid UTF-8 or would require escaping.pidβ Process IDuidβ UID, if you specify the--useroption.gidβ GID, if you specify the--useroption.typesβ Event type: Open, Read, Write, Close. Events on directories are+(create), Delete,<(moved from), or>(moved to). Combinations are possible, such asCWfor closing a written file, or<>for renaming a file within the same directory.
Directory events can only be detected on Linux 5.1 or higher.
deviceβ device ID in{"major":major,"minor":minor}form.inodeβ The file inode.pathβ The path to the affected file.path_rawβ The raw bytes of the path to the affected file, in case it is invalid UTF-8 or would require escaping.exeβ The path to the executable, if you specify the--exeoption.exe_rawβ The raw bytes of the executable path, in case it is not valid UTF-8 or would require escaping.parentsβ An array of parent processes, if you specify the--parentsoption. Each item is an object containingpid,comm,comm_raw,exeandexe_rawfields as appropriate. Iffatracefails to determine some of this information, fields may be missing or the list may end before the process with ID 1.
π OPTIONS π
-c,--current-mountβ Only record events on partition/mount of current directory. Without this option, all (real) partitions/mount points are being watched.-o FILE,--output=FILEβ Write events to given file instead of standard output.-s SECONDS,--seconds=SECONDSβ Stop after the given number of seconds.-t,--timestampβ Add timestamp to events. When this option is given once, the format will be a human readablehour:minute:second.microsecond; when given twice, the timestamp is printed as seconds/microseconds since the epoch.-u,--userβ Add process user information to events.-p PID,--ignore-pid=PIDβ Ignore events for this process ID. Can be specified multiple times.-f TYPES,--filter=TYPESβ Show only the given event types.TYPESis a list ofC,R,O,W,D,+, or<with the above meanings.<and>both mean "move" and will always enable both directions.
E. g. use --filter=OC to only show open and close events.
-C COMMAND,--command=COMMANDβ Show only events for this command.-j,--jsonβ Write events in JSONL format (see definition above).-P,--parentsβ Print information about all parent processes.-e,--exeβ Print executable path.-h,--helpβ Print help and exit.
π AUTHOR π
fatrace is developed by Martin Pitt <martin@piware.de>. π
and that's the whole page, bestie π«Ά β penned by Martin Pitt on August 20, 2020, and it's giving System Manager's Manual energy from start to finish. go find out who's touching your files. mwah. πβ¨
π¦ where this page comes from
- fedora 43: fatrace 0.19.1-2.fc43 Β· GPL-3.0-or-later
- fedora 44: fatrace 0.19.1-3.fc44 Β· GPL-3.0-or-later
- nixos 26.05: fatrace 0.19.1
- nixpkgs unstable: fatrace 0.19.1
- ubuntu resolute: fatrace 0.19.0-2 Β· GPL-3.0-or-later
- ubuntu stonking: fatrace 0.19.0-2 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms