Shell Script To Remove All Keys Belonging To Hostname From a ~/.known_hosts File

in Categories File-management last updated December 14, 2009

How Do I Use This Script?

Simply run it as follows:

Share this on:

1 comment

  1. ips=$(host “$host” | awk -F’address’ ‘{ print $2}’ | sed -e ‘s/^ //g’)

    could be shorten to: ips=$(host “$host” | awk ‘/address/ { print $NF }’)

    Have a question? Post it on our forum!