summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xget-hosts7
1 files changed, 7 insertions, 0 deletions
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 "$@"