Skip to content

Instantly share code, notes, and snippets.

@lkslts64
Created September 21, 2021 11:51
Show Gist options
  • Save lkslts64/1178e7b7a10893945b35422062760836 to your computer and use it in GitHub Desktop.
Save lkslts64/1178e7b7a10893945b35422062760836 to your computer and use it in GitHub Desktop.
Script for statistics generation from macOS keylogger (https://github.com/caseyscarborough/keylogger) output
#!/bin/bash
# Usage:
# $ ./stats <<keylogger_output_filename>>
#
# Example output:
# 1784 [left-cmd]
# 1122 [left-ctrl]
# 1020 [return]
# 801 [del]
# 738 k
# 553
# 539 t
# 485 l
# 420 [esc]
# 418 h
# 413 b
# 405 [up]
# ...
# ...
# ...
# 3 C
# 2 {
# 2 [f8]
# 2 Y
# 2 J
# 2 @
# 2 *
# 1 `
# 1 [f4]
# 1 [f13]
tail -n 1 $1 | sed -E 's/(\[[^]]+\]|[^[])/\1\n/g' | sort | uniq -c | sort -nr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment