-
-
Save thcipriani/6de5841f15a4808a4e01ddda42b2d41e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
tail -n 10000 "$HOME/.muh_history" 2>/dev/null \ | |
| awk '{for (i=5; i<=NF; i++) | |
printf "%s ", | |
$i; | |
print ""}' \ | |
| sort \ | |
| uniq -c \ | |
| sort -n \ | |
| awk '{$1=$1};1' \ | |
| cut -d' ' -f2- \ | |
| fzf --tac --query="$@" \ | |
| python -c ' | |
import sys | |
import fcntl | |
import termios | |
for b in sys.stdin.buffer.read(): | |
fcntl.ioctl(sys.stdout.fileno(), termios.TIOCSTI, bytes([b]))' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment