cheat:strace
# To strace a command:
strace <command>
# To save the trace to a file:
strace -o <outfile> <command>
# To follow only the open() system call:
strace -e trace=open <command>
# To follow all the system calls which open a file:
strace -e trace=file <command>
# To follow all the system calls associated with process management:
strace -e trace=process <command>
# To follow child processes as they are created:
strace -f <command>
# To count time, calls and errors for each system call:
strace -c <command>
# To trace a running process (multiple PIDs can be specified):
strace -p <pid>
tldr:strace
# strace
# Troubleshooting tool for tracing system calls.
# More information: <https://manned.org/strace>.
# Start tracing a specific process by its PID:
strace -p pid
# Trace a process and filter output by system call:
strace -p pid -e system_call_name
# Count time, calls, and errors for each system call and report a summary on program exit:
strace -p pid -c
# Show the time spent in every system call:
strace -p pid -T
# Start tracing a program by executing it:
strace program
# Start tracing file operations of a program:
strace -e trace=file program
$
cheat.sh