Session and utilities

The strace command

Runs a program showing the system calls it makes. It is the magnifying glass to understand what it really touches.

Syntax

strace comando

Most useful options

-fFollows child processes too
-eFilters by call type
-p PIDAttaches to a running process

Copy-ready examples

$ strace lsSee ls's calls

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • The output is huge: filter with -e or save it to a file.

Related commands

FAQ

What is it for in practice?

To debug why a program fails or which files it tries to open.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course