Martin Urwin was armed with the weapon when he was searched by police at South Shields Metro station in South Tyneside on December 10 last year.
The 40-year-old claimed he had armed himself for his own protection.
Prosecutor Barry Robson told Newcastle Crown Court: "When interviewed by the police he accepted it was an offensive weapon, a bladed article.
"He said he had it in his possession because he had been assaulted three times previously and it was for his own self protection."
The court heard Urwin had been released from prison in October after serving a sentence for carrying a knife in similar circumstances last summer.
Urwin, of no fixed address, admitted having a bladed article.
Steven Reed, defending, said Urwin has mental health problems and was living homeless.
Mr Reed told the court: "He fully accepts his actions were incorrect.
"The excuse he gave, he understands, is wrong."
Mr Recorder Christopher Williams jailed Urwin for six months.
The judge told him: "I hope you will find help and find a way to put your life back on track."