As this page's introduction notes, modern English translations of The Bible don't say "Thou shalt not kill", they say "You shall not murder/shed innocent blood". In other words, don't kill someone without a very good reason. Warfare and capital punishment were accepted practice in ancient Israel and in many cases sanctioned by God. Killing in self-defense of your own life, or killing someone who is currently attempting to murder someone else, and execution of convicted murderers is likewise permissible and even obligatory under Biblical law.
The greatest warrior is he who does not need to kill
In J. R. R. Tolkien's The Lord of the Rings, when Gandalf tells how Mordor has learned from Gollum that the One Ring is now in the possession of hobbits, Frodo exclaims, "What a pity that Bilbo did not stab that vile creature, when he had a chance!" Gandalf admonishes him:
Gandalf: "Pity? It was Pity that stayed his hand. Pity, and Mercy: not to strike without need... Deserves death! I daresay he does. Many that live deserve death. And some that die deserve life. Can you give it to them? Then do not be too eager to deal out death in judgment. For even the very wise cannot see all ends."
This really comes down to the difference between killing an enemy in battle (which neither Frodo nor Gandalf shows any aversion to) and executing a defeated foe. And as it turns out, Frodo fails in his quest to destroy the One Ring, with Gollum completing it for him... by accident. Which could tie into some translations of the trope-naming commandment using "murder" instead of "kill".
The same mercy is shown to Gríma Wormtongue (twice!) and Saruman as well. Neither can comprehend mercy, thinking it's a trick. As a contrast, Gríma kills Saruman at the end.
This is spoofed in the prologue to Bored of the Rings, where, after the answer to "What have I got in my pocket?" is demonstrated to be a .38 pistol, the thought behind "pity stayed his hand" is explained as "It's a pity I've run out of bullets."
The Seekers of Truth use this, as they work with the law enforcement and justice system. A couple of them violate this rule once, which as it turns out is one time too many.
Interesting subversion in Warrior Cats, where the warrior code says: "An honorable warrior does not need to kill other cats to win his battles, unless they are outside the warrior code or it is necessary for self-defense.", so Thou Shalt Not Kill... unless it's in self-defense... or the person you're killing really deserves it. But you are still just considered "dishonorable" (although, being Proud Warrior Race Guys, this is A Fate Worse Than Death for some). The rule is still important, though, and main characters have so far only killed Big Bads, and at times have had to be restrained from killing others.
Pulp hero Doc Savage started out killing bad guys left and right, but evolved a pragmatic "don't kill unless there's no other way" policy after the first few stories. Many a villain ended up fatally Hoist by His Own Petard. More often than not, Doc knows this is going to happen (since he's sabotaged the weapon) and tries to warn the Big Bad, who just laughs and pushes what has now become the Big Red Button.
An alien race in Tom Holt's Falling Sideways had this as a rule. They also had a very high level of technology and the collective mindset of a Rules Lawyer. As in, it's OK to make people believe themselves to be frogs and eat nothing but flies, because they have a rule saying "Thou Shalt Not Kill" but not "Thou Shalt Not Make People Feed Themselves Horribly Inadequate Diets".
In The Mysterious Benedict Society books, Kate's father, Milligan, always works to find solutions that would avoid killing his opponents (generally the vicious Ten Men) no matter how savagely they try to kill him or others. When asked about this by his daughter, Kate, he tells her simply "We're not like them." Indeed, when Kate later has the opportunity to toss a bomb at them and their leader, Mr. Curtain, she instead tosses it away into the water where it can do no harm.
In the Harry Potter series, the rules here are… tricky. Wands are often wielded threateningly like guns, yet the actual Killing Curse, Avada Kedavra, is extremely illegal, and using it possibly requires some degree of malice. (Doesn't count in case of Mrs. Weasley, since she didn't use the Killing Curse, but a Stunning spell so powerful it caused heart attack in Bellatrix as per Word of God, and almost certainly not for Snape's mercy-killing Dumbledore). Nonetheless, there are numerous other spells (like Sectumsempra) which would presumably also cause death under the right circumstances. In Book 7, the disarming spell, Expelliarmus, becomes Harry's pacifistic trademark, and the following conversation occurs:
Lupin: "Harry, the time for Disarming is past! These people are trying to capture and kill you! At least Stun if you aren't prepared to kill!"
Harry: "We were hundreds of feet up! If I Stunned him and he'd fallen, he'd have died the same as if I'd used Avada Kedavra!"
Of course, he was perfectly willing to shoot his pursuers off their brooms earlier and only stayed his hand when he recognised a familiar face in one of them ("familiar" in this case means he'd known him several years ago for a few hours), so his point is a bit shaky.
The magical world apparently has extremely dim views about killing, since murder with magic can literally rip your soul in half.
Artemis Fowl tends to avoid any killing by the good guys, regardless of possible need or justification. No character at all died in the first book, and the only deaths in the second were three goblin assassins, one by Karmic Death in an avalanche and the other two shot in the back by their accomplice, as well as the Big Bad's second-in-command also by accidental Karmic Death.
This seems to have at least slightly changed once Sazed took control of Ruin and Preservation and became a god, as in the second era, there's at least one kandra who's killed someone that hasn't been executed, albeit in self-defense.
In The Dresden Files, the First law of Magic specifies that Thou Shalt Not Kill With Magic. Violating this law generally leads to execution by the White Council, except in rare cases where the wizard responsible was judged to be acting in self-defense and another wizard is willing to mentor the killer. Killing people without magic is allowed if circumstances dictate though. The sole exception to this is the Blackstaff, who is allowed to kill if it is deemed absolutely necessary. Also, the Law specifically states that it is illegal to kill humans. Killing supernatural creatures such as faeries and vampires with magic is allowed, as the Laws only exist to protect humans.
Technically, the law is to not use black magic, which includes mind control and the like ( Hence Blackstaff). It gets into a grey area with regard to collateral damage from magic and largely involves intent as being a key factor, thus making it closer to Thou Shalt Not Murder. Because of the nature of magic in the Dresdenverse, a person must believe in what they are doing. So using black magic and murder actually taints the soul and is very addictive. For what it is worth The Blackstaff is one of the kindest people in the series, and when he starts unleashing magic to kill it is a horrifying scene. The Blackstaff is allowed to break the Laws because the staff he wields somehow prevents his soul from being tainted.
In the Iron Druid Chronicles Druid magic cannot be used to harm a living being in any way. If you do, the magic will kill you on the spot. However, Druids can kill people in any number of mundane ways like cutting their heads off. The prohibition also only applies to direct magic use. Druid magic can be used to indirectly hurt someone (e.g. summoning elementals to do the fighting or simply having a hole appear in the earth so the opponent breaks a leg). It also does not apply to supernatural beings with no connection to the earth (eg demons).
In Wearing the Cape Hope's expectation is that superheroes follow the Golden Age superhero code, and this is strengthened by Ajax' statement that "heroes don't use guns." But in her first fight she discovers that Atlas is perfectly willing to let the bad guys kill each other, and in the surprise-attack on Whittier Base half the team breaks out automatic pistols, the better to cap their attackers. Hope herself kills an unspecified number of terrorists in the heat of combat, then kills two heroes in the Dark Anarchist's secret base.
In The Chronicles of Prydain, Lord Pryderi taunts the enchanter Dallben, believing that he "secret to his power" is that Dallben cannot kill. Dallben says he has never killed anyone, but that doesn't mean he can't.The issue is never settled, since Pryderi dies shortly thereafter without Dallben's intervention.
In Septimus Heap, Aunt Zelda has to remind Nicko of this when he suggests to make the Hunter remember he's not a lion tamer while he has his head in a lion's mouth.
In The Quantum Thief, the Sobornost collective hold a rare, villainous principle in this matter. They could wipe out all their enemies from the Solar System with Strangelet bombs in a matter of hours, but in their ideology, every mind has its place and every memory is worth preserving. It's just happens to be that they decide what place each mind should have, and they'll cheerfully Mind Rape the uploaded personalities into any function they find the most suitable, be it an infiltrator or a missile guidance system, and then copy them as needed. In their minds it's only a murder if all the copies of an uploaded individual are destroyed.
Trapped on Draconica: No matter who it is Daniar will not kill them, though some people really ask for it. She just about killed Zarracka after the third time she was spared. Interestingly, Rana doesn't persuade Daniar out of killing Zarracka out of concern for the villain's well being but to prevent Daniar from breaking her code.
During Galaxy of Fear, the protagonists will destroy basic speechless droids and squish beetles forming swarms, and Zak once accidentally kills a birdlike animal and feels remorse, but anything smarter, if it dies, dies some other way. In Spore, Tash flees Spore, which is controlling the crew of a Star Destroyer and taking it after her into an Asteroid Thicket, where it's attacked and destroyed by space slugs. Her Actual Pacifist friend, who flew with her, is horrified and feels like she's killed the crew. Tash says it's not the friend's fault, she was following Tash, but also puts the blame on Spore.
Similar to the Warrior Cats, Percy Jackson and the Olympians downplays the trope. While the demigod heroes do kill monsters, Death Is Cheap with them. They recover in any time between weeks and centuries. On the other hand, Percy deliberately avoids killing other demigods, though it's a bit like Harry Potter's example in that many of them are duped. The views of other demigods aren't really as known but probably were not as merciful.
The Exile's Violin: Jacquie is a downplayed example; after killing her father's murderer she swore to herself that she would never kill again but kills mooks when there is no other option. At the climax she kills Gunslinger because her rule is not a unbreakable rule.
In Steadfast, Kate's teachers impress upon her the need to not simply call on her Elemental allies to burn her abusive husband to ash. It's not that he doesn't deserve it, but her teachers don't want her to taint the innocence of her Elementals by using them to kill humans. This is specific to Kate and her teachers; using elementals to kill is elsewhere not considered to be Black Magic.
In A Brother's Price the protagonists do kill frequently when the need arises, but never with Jerin, the male protagonist, present. In one situation, a woman gives one of their enemies Tap on the Head, and reassures Jerin that no, she didn't kill her, and she is extremely sorry that he has to witness this. Later Jerin shoots a woman himself, and is shocked for moments afterwards. He did it in defense of his rescuer, Cira, and is extremely upset that he actually killed a human being. While reference to execution as punishement is made, a proper court proceedings beforehand is seen as preferable to killing in self-defense whenever possible. And even then, the protagonists don't like the thought of small children being executed for their mothers' crimes (as is the normal course of action, to avoid revenge being taken by the surviving offspring.)
In Dragon Bones, Ward, the protagonist, does kill in battle, but feels extremely bad about killing in cold blood when his life is not in immediate danger. He could have easily killed his abusive father, but never did, even though his father told him about the Klingon Promotion for which he killed Ward's grandfather. His reluctance to kill comes up later, when Oreg reveals that the only possible way to prevent the villains from winning is to kill Oreg - his life is bound to the castle in which the villains currently are, and killing him will make it collapse. Ward feels it goes against his very nature to kill someone he should be protecting. In the end, he does it, but falls into a kind of grief-induced coma afterwards.
In Jeramey Kraatz's The Cloak Society, the Cloak members were shocked when, in the Back Story, Lone Star killed many of them to stop their plot. They jeer at him as a killer. Later, Alex learned how deeply this had scarred Lone Star.
Taken as gospel by Gary Karkofsky in The Rules of Supervillainy as how superheroes should act. Notably, this idea is given a Lampshade Hanging by the fact Gary is the hero of the book and frequently kills but justifies it as he's a supervillain. Plus, all of his victims are psychopathic murderers much worse than him. This, ironically, makes him identical to the Nineties Antihero type characters he despises.