creates a bash function to remove certain lines from SSH known_hosts file

function sshdel { perl -i -n -e "print unless (\$. == $1)" ~/.ssh/known_hosts; }
sometimes you got conflicts using SSH (host changing ip, ip now belongs to a different machine) and you need to edit the file and remove the offending line from known_hosts. this does it much easier.
Sample Output
$ sshdel 30
< removes 30th line from the known_hosts file in ~/.ssh >

By: xsawyerx
2009-02-03 16:20:50

1 Alternatives + Submit Alt

What Others Think

ssh-keygen -R
Sekenre · 692 weeks and 4 days ago
kitchen remodeling dayton ohio This is great! Thanks so much!
yeoyeo · 78 weeks and 3 days ago
cant get over this. will recommend this to my friends. painters st george
looneyhans · 64 weeks and 4 days ago
I was reading some of your content on this website and I conceive this internet site is really informative ! Keep on putting up. ??
KayGasaway · 62 weeks and 1 day ago
Your articles are inventive. I am looking forward to reading the plethora of articles that you have linked here. Thumbs up! ?????
KayGasaway · 61 weeks ago
You have beaten yourself this time, and I appreciate you and hopping for some more informative posts in future. Thank you for sharing great information to us. ??? 1?
KayGasaway · 60 weeks and 2 days ago
Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post. The Float Life
KayGasaway · 59 weeks and 1 day ago
definately enjoy every little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog! Flightfins
KayGasaway · 58 weeks and 4 days ago
You have made some decent points there. I looked on the internet for more information about the issue and found most people will go along with your views on this web site. IT Support companies Beverlywoods Los Angeles
KayGasaway · 58 weeks ago
Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post. ??????
KayGasaway · 58 weeks ago
Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me.
KayGasaway · 58 weeks ago
Pretty nice post. I just stumbled upon your weblog and wanted to say that I have really enjoyed browsing your blog posts. After all I’ll be subscribing to your feed and I hope you write again soon! Educational toys
KayGasaway · 57 weeks and 6 days ago
Thank you for very usefull information.. ????
hiknigarde · 54 weeks and 4 days ago
I found so many interesting stuff in your blog especially its discussion. Really its great article. Keep it up. ?????joker
jackson2321 · 54 weeks ago
Thanks for taking the time to discuss that, I feel strongly about this and so really like getting to know more on this kind of field. Do you mind updating your blog post with additional insight? It should be really useful for all of us. eye doctor Tulsa
KayGasaway · 52 weeks and 5 days ago
We proudly serve the towns and cities located in the GTA west areas mainly Mississauga, Brampton, Milton, Oakville & Etobicoke, etc. Our fleet of tow trucks is readily available to accommodate any quick pickups for scrap cars in the above areas. junk cars for cash
ayesha · 47 weeks ago
Online Bingo is the most popular online game, Our best bingo sites ??list could save lots of searching time for you to find your favorite bingo sites and their sister sites confidently to play with the latest bonus and welcome offers.">best bingo sites
KayGasaway · 42 weeks and 2 days ago
If You are looking for great quality cheap canvas prints then Oh Sign A Wall is a place where can find the perfect solution for that. Uplifting canvas picture prints or vintage iconic metal signs with tons of designs and wall stickers are waiting for you. And we continuously look for new amazing wall decor must-haves, so visit our site to order canvas prints ?or explore our trending Products.
ayesha · 41 weeks and 6 days ago
Ertisun is a irish handmade jewellery brand with a passion for unique and delicate designs. Buy handmade designer jewellery online in Ireland. Please visit our site ?for more details, Thank You.
KayGasaway · 41 weeks and 3 days ago
seofox · 25 weeks and 3 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: