TRUSS(1)
π TRUSS(1) β like, the trace system calls manual, bestie
okay so you know how a program does a million tiny things you can't see? truss is the nosy bestie who follows it around and writes down every single system call it makes. it's giving surveillance but make it β¨educationalβ¨. this is truss(1), general commands manual, and it's gonna eat, i promise.
β¨ NAME β¨
truss β trace system calls π΅οΈββοΈ
π SYNOPSIS π
truss [-facedDHS] [-o file] [-s strsize] -p pid
truss [-facedDHS] [-o file] [-s strsize] command [args]
two whole ways to run it, pick your fighter π«Ά
πΈ DESCRIPTION πΈ
The truss utility traces the system calls called by the specified process or program. Output goes to whatever output file you named, or to standard error if you didn't. How does it do this little magic trick? By stopping and restarting the process being monitored via ptrace(2). yes bestie, ptrace(2), the icon herself.
The options are as follows:
-fβ Trace descendants of the original traced process created byfork(2),vfork(2), etc. and to tell whose event is whose, the process ID (PID) of the process gets included in the output of each event. whole family tree, monitored π-aβ Show the argument strings that are passed in eachexecve(2)system call. what did you say to it, huh-cβ Do not display individual system calls or signals. Instead, before exiting, print a summary containing for each system call: the total system time used, the number of times the call was invoked, and the number of times the call returned with an error. receipts only, no play-by-play π-eβ Show the environment strings that are passed in eachexecve(2)system call. the vibes it was raised in, essentially-dβ Include timestamps in the output showing the time elapsed since the trace was started. clock starts at zero, go β¨-Dβ Include timestamps in the output showing the time elapsed since the last recorded event. delta time, very main character-Hβ Include the thread ID of in the output of each event. (yes that's exactly how the original says it, no cap, i'm not editing the queen)-Sβ Do not display information about signals received by the process. (Normally,trussdisplays signal as well as system call events.) so you're muting the signal gossip π-ofile β Print the output to the specified file instead of standard error. take it to a private chat instead of the group chat-sstrsize β Display strings using at most strsize characters. If the buffer is larger,"..."will be displayed at the end of the string. The default strsize is32. we truncate, we don't overshare π₯-ppid β Follow the process specified by pid instead of a new command. lurking on someone already living their lifecommand [args]β Executecommandand trace the system calls of it. (The-pandcommandoptions are mutually exclusive.) you literally cannot do both, choose one, periodt
π¦ EXAMPLES π¦
Follow the system calls used in echoing "hello":
$ truss /bin/echo hello
Do the same, but put the output into a file:
$ truss -o /tmp/truss.out /bin/echo hello
Follow an already-running process:
$ truss -p 34
that's it. that's the whole tutorial. go be nosy π
π SEE ALSO π
dtrace(1), kdump(1), ktrace(1), ptrace(2), utrace(2), sysdecode(3)
the whole friend group, honestly π
β HISTORY β
The truss command was written by Sean Eric Fagan for FreeBSD. It was modeled after similar commands available for System V Release 4 and SunOS. a legend, an absolute icon, we stan π«Ά
and that's the whole page bestie!! this one's from the Debian manual, dated June 18, 2025, TRUSS(1) β mwah πβ¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms