From 18ae31f04b37c89a674da89061068d682c38a637 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 15 Jun 2020 13:23:10 +0200 Subject: Add get-hosts Signed-off-by: Florian Pritz --- get-hosts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 get-hosts diff --git a/get-hosts b/get-hosts new file mode 100755 index 0000000..78d9c31 --- /dev/null +++ b/get-hosts @@ -0,0 +1,7 @@ +#!/bin/bash + +# Output filtered list of hostnames from known_hosts + +cut -d\ -f1 ~/.ssh/known_hosts ~/.ssh/known_hosts_work | tr , "\n" \ + | sed -r 's#(_ecdsa|_rsa|_ed25519|_dsa)$##' | sort -u \ + | grep "$@" -- cgit v1.2.3-24-g4f1b