Where to start First steps track · 15 stages
Linux Labs

strace — which system calls a process makes

cheat sheet · strace 6.8 · Ubuntu 24.04 https://lab.dimsanych.ru/en/wiki/strace/

Cheat sheet

  • strace cat /etc/hostname all calls of a command
  • strace -f sh -c '…' and of its children
  • strace -e trace=openat cmd openat only
  • strace -f -e trace=file cmd everything with file paths
  • strace -e trace=network cmd sockets and connections
  • strace -o /tmp/t.log -f cmd to a file, apart from the output
  • strace -c ls /etc > /dev/null summary: calls of each kind
  • sudo timeout 10 strace -p 1234 attach to a process

Options

The main options are in the table below. The full list is man strace.

Loading…