bashreadline.bt(8) System Manager's Manual bashreadline.bt(8)

# [NAME](#NAME)

bashreadline.bt - Print bash commands system wide. Uses bpftrace/eBPF.

# [SYNOPSIS](#SYNOPSIS)

**bashreadline.bt**

# [DESCRIPTION](#DESCRIPTION)

bashreadline traces the return of the readline() function using uretprobes, to show the bash commands that were entered interactively, system wide. The entered command may fail: this is just showing what was entered.

This program is also a basic example of bpftrace and uretprobes.

Since this uses BPF, only the root user can use this tool.

# [REQUIREMENTS](#REQUIREMENTS)

CONFIG\_BPF and bpftrace.

# [EXAMPLES](#EXAMPLES)

[Trace bash commands system wide:](#Trace)

\# **bashreadline.bt**

# [FIELDS](#FIELDS)

[TIME](#TIME)

A timestamp on the output, in "HH:MM:SS" format.

[PID](#PID)

The process ID for bash.

[COMMAND](#COMMAND)

Entered command.

# [OVERHEAD](#OVERHEAD)

As the rate of interactive bash commands is expected to be very low (&lt;&lt;100/s), the overhead of this program is expected to be negligible.

# [SOURCE](#SOURCE)

This is from bpftrace.

https://github.com/bpftrace/bpftrace

Also look in the bpftrace distribution for a companion \_examples.txt file containing example usage, output, and commentary for this tool.

This is a bpftrace version of the bcc tool of the same name. The bcc tool may provide more options and customizations.

https://github.com/iovisor/bcc

# [OS](#OS)

Linux

# [STABILITY](#STABILITY)

Unstable - in development.

# [AUTHOR](#AUTHOR)

Brendan Gregg

# [SEE ALSO](#SEE_ALSO)

[opensnoop.bt(8)](/man/enterprise-packages/bpftrace/opensnoop.bt.8)

2018-09-06 USER COMMANDS

---

Document: bashreadline.bt(8) from bpftrace 0.27.0-r1 (Chainguard OS)
Source: https://github.com/bpftrace/bpftrace
