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 comandoMost useful options
-fFollows child processes too-eFilters by call type-p PIDAttaches to a running processCopy-ready examples
$ strace lsSee ls's callsYou 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.
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