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


bestie, that's the whole page 🫢 this was a USER COMMANDS manual page, dated 2016-01-28, for bashreadline(8). periodt πŸ’–βœ¨