bashreadline.bt(8)
π NAME π
okay so bestie, meet bashreadline.bt β the manual page lives in section 8, and this little icon prints bash commands system wide. Uses bpftrace/eBPF, no big deal π
β¨ SYNOPSIS β¨
bashreadline.bt
that's it. that's the whole vibe. she takes no arguments, she just watches. π
π DESCRIPTION π
so what she does is trace the return of the readline() function using uretprobes, and that's how she shows you the bash commands people entered interactively, system wide. like, every bash on the machine. the way she sees everything?? main character energy fr fr.
heads up though β the entered command may fail. this tool is just showing you what was entered, not whether it worked. no cap, don't read it as "this command succeeded", because that's not what's happening. π«Ά
also she's a basic example of bpftrace and uretprobes, so if you're learning those, she's lowkey a great study buddy.
and because this uses BPF, only the root user can use this tool. periodt. π
π REQUIREMENTS π
CONFIG_BPFbpftrace
that's the whole checklist, bestie. β¨
π¦ EXAMPLES π¦
trace bash commands system wide:
# bashreadline.bt
π FIELDS π
TIMEβ a timestamp on the output, in"HH:MM:SS"format.PIDβ the process ID for bash.COMMANDβ entered command.
π§ OVERHEAD π§
ngl the overhead here is expected to be negligible β because the rate of interactive bash commands is expected to be very low (<<100/s). she's basically sipping her drink in the corner, not even breaking a sweat. π
π SOURCE π
this is from bpftrace.
https://github.com/iovisor/bpftrace
also, go look in the bpftrace distribution for a companion _examples.txt file β it's got example usage, output, and commentary for this tool. very slay of them to include that. π
and bestie, know this: she's a bpftrace version of the bcc tool of the same name. the bcc tool may provide more options and customizations, so if you want more knobs to turn, go check that one out:
https://github.com/iovisor/bcc
π§ OS π§
Linux
π STABILITY π
Unstable β in development.
so likeβ¦ she's growing, she's evolving, she's in her development era. handle with care. π«Ά
πΈ AUTHOR πΈ
Brendan Gregg
β SEE ALSO β
okay that's the whole page!! sending you the biggest virtual hug for reading all of it π«Άπ this was the USER COMMANDS version, dated 2018-09-06, and yes bestie, the page itself is literally named bashreadline.bt(8) β iconic from start to finish. now go trace some commands, you absolute legend. πβ¨
π¦ where this page comes from
- debian bookworm: bpftrace 0.17.0-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms