bashreadline(8)
β¨ bashreadline(8) β bashreadline π
Manual name: bashreadline β print entered bash commands system wide. Uses Linux eBPF/bcc. π¦
π NAME
bestie, bashreadline prints every bash command that gets entered, system wide πΈ It runs on Linux eBPF/bcc β¨
π SYNOPSIS
bashreadline [-h] [-s SHARED]
π DESCRIPTION
okay so bashreadline traces the return of the readline() function using uprobes π₯ that means it shows the bash commands that were typed in interactively, system wide, no cap π
the entered command might fail, and that's totally fine. this is just showing what was entered, not whether it worked π
this program is also a basic example of eBPF/bcc and uprobes, so it's giving teaching vibes π§
this makes use of a Linux 4.4 feature (bpf_perf_event_output()) β¨ for kernels older than 4.4, check the version under tools/old, which uses an older mechanism π
since this uses BPF, only the root user can use this tool π main character energy is not the vibe for regular users here π
π«Ά REQUIREMENTS
you'll need CONFIG_BPF and bcc π
β¨ OPTIONS β¨
-hβ print the usage message π-sβ specify the location of the libreadline.so shared library π¦ use this when the script fails to run directly with the error: "Exception: could not determine address of symbol Β΄readlineΒ΄". the default value is/lib/libreadline.soπ
π EXAMPLES
trace bash commands system wide:
# bashreadline
π₯ FIELDS
- TIME β time of the command, formatted as
HH:MM:SSβ - PID β process ID of the bash shell π§
- COMMAND β the entered command π
πΈ OVERHEAD
the rate of interactive bash commands is expected to be very low (<<100/s), so the overhead of this program is expected to be negligible π«Ά iykyk, it's basically nothing β¨
π¦ SOURCE
this is from bcc π
https://github.com/iovisor/bcc
also look in the bcc distribution for a companion _examples.txt file containing example usage, output, and commentary for this tool π
π OS
Linux π§
π STABILITY
Unstable - in development π
π AUTHOR
Brendan Gregg π
π§ SEE ALSO
opensnoop(8)π
bestie, that's the whole page π«Ά this was a USER COMMANDS manual page, dated 2016-01-28, for bashreadline(8). periodt πβ¨
π¦ where this page comes from
- debian bookworm: bpfcc-tools 0.26.0+ds-1 Β· Apache-2.0
- debian trixie: bpfcc-tools 0.31.0+ds-7 Β· Apache-2.0
- ubuntu jammy: bpfcc-tools 0.18.0+ds-2 Β· Apache-2.0
- ubuntu noble: bpfcc-tools 0.29.1+ds-1ubuntu7 Β· Apache-2.0
- ubuntu questing: bpfcc-tools 0.31.0+ds-7ubuntu2 Β· Apache-2.0
- ubuntu resolute: bpfcc-tools 0.35.0+ds-1ubuntu2 Β· Apache-2.0
- ubuntu stonking: bpfcc-tools 0.35.0+ds-1ubuntu4 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms