The man was arrested at the local bus station.
When police received a report of a man armed with a knife near the bus depot in Derry they found a man with a 7 inch blade, the local magistrates court heard today.
Scott McElwee, 23, of Tamlough Park in Ballykelly, admitted possessing an offensive weapon in a public place on July 24 last.
The court was told that police were called at around 12.40pm after a report of a man being seen with a knife in Foyle Street.
The man was followed on CCTV and was seen going into the bus depot and going into the toilets.
Police responded and they approached and ordered McElwee to lie on the ground which he did and he told police he had a knife in his waistband.
At interview, McElwee told police he had been at home when he received a call from his pregnant girlfriend who was in Derry shopping saying that she had been intimidated by a family known to her.
He said he grabbed the knife and went to find his girlfriend.
He said he showed the knife to scare the other person.
Defence solicitor, Keith Kyle, said McElwee had pleaded guilty at the earliest opportunity.
He said he had no intention of actually using the knife and added that McElwee's 'decision making was not good at this time'
District Judge Barney McElholm the problem was if someone takes a knife to a fist fight it escalates things. Then the next thing someone takes a gun to a knife fight, added the judge.
He sentenced McElwee to two months in prison.
If you have a story or want to send a photo or video to us please contact the Derry Now editorial team on 028 7129 6600 for Derry City stories Or 028 7774 3970 for County Derry stories. Or you can email email@example.com or firstname.lastname@example.org at any time.
Subscribe or register today to discover more from Derrynow.com
Buy the e-paper of the Derry News and the County Derry Post here for instant access to Derry's premier news titles.
Keep up with the latest news from Derry with our daily newsletter featuring the most important stories of the day delivered to your inbox every evening at 5pm.