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/hostnameall calls of a command -
strace -f sh -c '…'and of its children -
strace -e trace=openat cmdopenat only -
strace -f -e trace=file cmdeverything with file paths -
strace -e trace=network cmdsockets and connections -
strace -o /tmp/t.log -f cmdto a file, apart from the output -
strace -c ls /etc > /dev/nullsummary: calls of each kind -
sudo timeout 10 strace -p 1234attach to a process
Options
The main options are in the table below. The full list is man strace.