Skip to content

Instantly share code, notes, and snippets.

@mak3r
Created March 25, 2020 18:33
Show Gist options
  • Save mak3r/8ebdfddaa3c2f891b2beb66cbaf33661 to your computer and use it in GitHub Desktop.
Save mak3r/8ebdfddaa3c2f891b2beb66cbaf33661 to your computer and use it in GitHub Desktop.
delete a single line of a file - super useful when ssh complains about re-issued keys in known_hosts
#!/bin/sh
file=$1
line=$2
sed -i.bak -e "$2d" "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment