I have been reading about Shotokan Karate which appeals to me. In terms of real world scenarios e.g. ;
An attacker..
grabs your collars
he throws a punch to your stomach
he throws a punch to your face
he knees your crotch
he throws a backfist to your face
he kicks your crotch
he's in your face and goes to headbut you
he grabs you from behind in a headlock
he grabs your testicles
he pulls out a knife waving it about
he grabs your hair
he gets in your face and pushes you with both hands
he kicks your shins
he grabs you from the front getting you in a headlock
How would a knowledge of Shotokan Karate deal with such attacks?
The answer for karate is in the katas - they are exactly the close combat syllabus to deal with these situations.
In extremely general terms, all katas are about going into the attacker with your head and body as protected as possible, quickly removing the obstacles (most often his arms) which prevent you hit his head or chest or groin, and then proceeding to hit the aforementioned. Some katas aim to impair, others aim to break joints and bones or even worse.
Most katas show also a follow-up and how to try again if an attack doesn't work. There's usually very little fancy and complicated stuff and no parries - the idea is that at close range it's impossible to block much so the attack is the parry, and if the first move is blocked, the second will do the job.
For the same reason there are also no fancy kicks in katas - only very simple ones that dont require particular athleticism or youth (but still require practice, a lot!). Generally katas work by you establishing a mental space around you and telling off anyone who comes too close, and if he/she doesn't listen and persists, launch an attack, get the wannabe attacker unconscious or impaired and escape.
However, there's a few catches. First, most Shotokan dojos do not emphasize at all self defense, and many - if not most - never ever show what the katas really are for. The whole japanesization of karate way back was about making it a fitness sport and the self-defense root were viewed as antiquated and pointless.
Often basic techniques and katas are taught as hyper-stylized dances, with emphasis on stuff that is rather irrelevant in a self-defence situation, and full disregard for stuff that is. In fairness, modern civilization (also in early XX-century Japan) is a long way from the dark country roads of the RyuKyu kingdom so the whole idea of whacking hard anyone who didn't back off was toned down quite a bit, for a good reason.
Second, in Shotokan the parts of the art that deal with throwings, joint manipulations and weapons aren't trained at all - again, swords and similar were seen as antiquated and Japan had already Judo when karate was imported there, so it had to remove these aspects to be accepted (and later added the fancy kicks from Savate for military purposes, like in France). This further obscures the meaning of many katas, which contain throws aplenty, and makes it difficult to train them for what they were meant to be in your regular Shotokan dojo - that is attack sequences in a self-defence situation.
Third, karate in general and Shotokan in particular has developed into a sport, which has a completely different perspective than self-defense, and that's what most dojos train for.
Training for a combat sport - while it certainly helps stamina, reflexes etc - it's a very different mindset, and a fight works physically in very different way (you are a distance in some sort of guard, go in, do your combo, go out again, another combo etc until one combo hits): there is nothing of the overwhelming, explosive and sudden violence of a a self-defense situation. So sports karate training (which is, the training that is available to most) won't really help very much for self-defense.
So while karate is perfect for what you're asking, it's most likely that a Shotokan dojo will give you only some of the basics (which are anyways awesome) and you'll have to explore the self-defense applications by yourself.