An ex became angry after discovering his former wife had been added by another man as a Facebook friend, Lincoln Crown Court was told.
Timothy Smith turned up at the home address of Peter Odlin in Louth and stormed into the property.
Lisa Hardy, prosecuting, told the court: “Smith was very angry. He confronted Peter Odlin about why he had put Smith’s ex-wife as a friend on Facebook.
Miss Hardy said: “He stormed into the address and shouted at Mr Odlin. It is clear that he felt paranoid.
“Smith was shouting as to why Mr Odlin had wanted Smith’s ex-wife as a Facebook friend.
“Smith took out a kitchen knife and held it to Mr Odlin’s throat. He didn’t threaten him. He threw the knife down on the ground, shouted his discontent at Facebook and then left the property.”
Miss Hardy added that at the time of the incident Smith was in a relationship with a former partner of Mr Odlin and had earlier been repeatedly hanging around the property in Elm Drive, Louth, despite being told to go away.
Smith,45, of no fixed address, admitted charges of common assault on November 15, 2014 and harassment between November 1, 2014 and January 26 this year.
He also admitted breach of a conditional discharge imposed in October 2014 for an offence of battery on his estranged wife.
Smith was jailed for a total of 44 weeks.
Jack Talbot, defending, said Smith had originally faced more serious offences and had spent six months in custody awaiting his court appearance.
Mr Talbot said: “He has five children. He was in full-time employment before his remand into custody.”