bashreadline.bt(8)
π bashreadline.bt(8) π
β¨ NAME β¨
bashreadline.bt, okay so this one prints bash commands system wide π It runs on bpftrace/eBPF π¦
π SYNOPSIS π
bashreadline.bt
π DESCRIPTION π
okay so bashreadline traces the return of the readline() function using uretprobes β¨ which means it shows you every bash command that somebody typed in interactively, across the whole system π
The command might fail, and that's totally fine bestie, because this tool is just showing what got entered π
This program is also a basic example of bpftrace and uretprobes, so it's kind of a starter pack π§
Since this uses BPF, only the root user can use this tool π₯ (no cap, you need root for this one)
π REQUIREMENTS π
You need CONFIG_BPF and bpftrace β¨
π 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β 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 π«Ά literally not a big deal
π₯ 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 π
Linux π§
π STABILITY π
Unstable, it's still in development, so be gentle with it π₯Ί
π§ AUTHOR π§
Brendan Gregg π
π¦ SEE ALSO π¦
opensnoop.bt(8) π
Byeee bestie, this was the bashreadline.bt(8) page from the USER COMMANDS section, dated 2018-09-06 ππβ¨
π¦ where this page comes from
- alpine 3.24: bpftrace-tools-doc 0.26.1-r0 Β· Apache-2.0
- arch rolling: bpftrace 0.27.0-2 Β· Apache-2.0
- centos-stream 10: bpftrace 0.26.1-1.el10 Β· Apache-2.0
- centos-stream 9: bpftrace 0.26.1-1.el9 Β· ASL 2.0
- debian trixie: bpftrace 0.23.2-1 Β· Apache-2.0
- fedora 43: bpftrace 0.24.0-1.fc43 Β· Apache-2.0
- fedora 43: bpftrace 0.24.2-1.fc43 Β· Apache-2.0
- fedora 44: bpftrace 0.24.2-3.fc44 Β· Apache-2.0
- nixos 26.05: bpftrace 0.25.1
- nixpkgs unstable: bpftrace 0.27.1
- opensuse-leap 16.0: bpftrace-tools 0.23.5-160000.1.2 Β· Apache-2.0
- ubuntu questing: bpftrace 0.23.5-1ubuntu1 Β· Apache-2.0
- ubuntu resolute: bpftrace 0.25.0-1ubuntu1 Β· Apache-2.0
- ubuntu stonking: bpftrace 0.25.0-1ubuntu2 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms