Hovverry Your're right, shouting won't work, he probably thinks you're barking along with him and it'll just make him bark more.
My dog is from a very barky breed, not because she's a terrier, she isn't, she's just a very yappy sort of breed.
I have managed to train her not to bark all the time, and in fact, she doesn't bark much at all now.
Choose a word and when he's barking wait till he stops, use the word and treat him. Keep doing that and gradually work it so that when he barks you use the word and then treat him when and if he stops.
No idea if that's a good way to go about it but it worked very well for my dog.
She can have a bit of a bark when someone rings the door bell but will stop when I tell her to 'calm down' - that being the phrase I use, obviously - and the same if there's noise outside when she's in the garden.
It wasn't quick or easy and took time and consistent effort on my part, barking being such a rewarding thing for dogs, but it can be done.
I'm sure there's probably a lot of information online as well on how to train dogs not to bark so much.