Forrest logo
back to the truss tool

truss:tldr:e1b93

truss: Trace a process filtering output by system call.
$ truss -p ${pid} -t ${system_call_name}
try on your machine

The command "truss -p ${pid} -t ${system_call_name}" is used to trace the system calls made by a specific process identified by its process ID (PID). Here's the breakdown of the command:

  • truss: This is the command used on Unix-like systems, such as Solaris or FreeBSD, to trace system calls and signals of a running process. Similar functionalities exist under different names on other operating systems, like strace on Linux.

  • -p ${pid}: The "-p" option is used to specify the PID of the process that you want to trace. The "${pid}" placeholder should be replaced with the actual process ID you wish to trace.

  • -t ${system_call_name}: The "-t" option is used to filter and display specific types of system calls. The "${system_call_name}" is a placeholder that should be replaced with the name of the system call you want to trace. For example, if you want to trace only the "read" system calls, you would replace "${system_call_name}" with "read".

By executing this command, the system will start tracing the specified system calls made by the chosen process, allowing you to analyze and debug the behavior of the process at the system call level.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the truss tool