• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

strace: command not found

by Deepika

strace is a debugging tool that allows you to monitor system calls and signals made by a process. It can be used to track down the source of errors and diagnose system problems by displaying the system calls a program makes as it runs, along with any error messages that are generated.

strace works by intercepting and reporting the system calls made by a program to the kernel, as well as any signals sent or received. It can be used to monitor a single process or a group of processes, and can be run on both command-line and graphical applications.

The output of strace can be quite verbose, and it is often helpful to use filters to limit the amount of data that is displayed. Some common filters include -e to specify which system calls to monitor, -p to monitor a specific process, and -o to redirect the output to a file.

If you encounter the below error while running the command strace:

strace: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install strace
Ubuntu apt-get install strace
Alpine apk add strace
Arch Linux pacman -S strace
Kali Linux apt-get install strace
CentOS yum install strace
Fedora dnf install strace
Raspbian apt-get install strace

strace Command Examples

1. Start tracing a specific process by its PID:

# strace -p pid

2. Trace a process and filter output by system call:

# strace -p pid -e system_call_name

3. Count time, calls, and errors for each system call and report a summary on program exit:

# strace -p pid -c

4. Show the time spent in every system call:

# strace -p pid -T

5. Start tracing a program by executing it:

# strace program

6. Start tracing file operations of a program:

# strace -e trace=file program

Summary

strace is a powerful tool that can be used to troubleshoot a wide range of issues, including file and network access, system resource usage, and program crashes. However, it should be used with caution, as it can also be used to monitor sensitive data, such as passwords and encryption keys.

Filed Under: Linux

Some more articles you might also be interested in …

  1. setsid: command not found
  2. daps: open source program for transforming DocBook XML into output formats such as HTML or PDF
  3. yum Command Examples in Linux
  4. lvm: command not found
  5. lxi: command not found
  6. How to modify the iSCSI initiator ID in Linux
  7. Arcanist: A CLI for Phabricator (arc Command Examples)
  8. rspamc Command Examples in Linux
  9. top Command Examples in Linux
  10. arch Command – Display the name of the system architecture (Command Examples)

You May Also Like

Primary Sidebar

Recent Posts

  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples
  • “glab mr” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright