Was "The 'F' Word" in common usage in the 1800s?

The usage of the “F”word as well as other swear words appears to be exaggerated and not historically correct, but effective from a fictional point of view as noted in the following extract by American lexical semantician and author Geoffrey Nunberg:

If you have your characters use historically accurate swear words, they're apt to sound no more offensive than your grandmother in a mild snit. The only way to convey the potency of their oaths is to have them use modern swear-words, even if they're anachronistic.

That's the approach taken by the HBO series "Deadwood," set in a South Dakota mining camp in the 1870's. As a lot of people have noted, the show is positively swilling in obscenity -- the characters use "fuck" and "fucking" with a frequency that would make Tony Soprano blush.1

But "fuck" wasn't actually a swear-word back then. It was indecent, of course, but people only used it for the sexual act itself. Whereas swear-words are the ones that become detached from their literal meanings and float free as mere intensifiers. Swearing isn't using "fucking" when you're referring to sex, it's using it when you're talking about the weather.

In fact when you look up the word in Jonathan Lighter's magisterial Dictionary of American Slang, you discover that the all-purpose insult "fuck you" was a turn-of-the twentieth-century creation, and "go fuck yourself" isn't attested until 1920. "Fucked up" and "Don't fuck with me" didn't show up till around the time of the Second World War. And while people may have been emphasizing nouns with "fucking" from the 1890's, it wasn't until well into the century that you heard things things like "She fucking well better tell me" or "Get the fuck out of here” both "Deadwood" favorites.

(people.ischool.berkeley.edu)