bashreadline.bt(8)

πŸ“¦
version 0.27.0 Β· 3 versions
  • 0.27.0 Β· alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.14.0 Β· ubuntu jammy
  • 0.20.2 Β· ubuntu noble
, in alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 πŸŽ€πŸ’–βœ¨