Man jailed for threatening six people with a knife