copy last command in terminal
Put this into your ~/.bashrc ~/.bash_profile or where-ever you like it:

alias copyLastCmd='fc -ln -1 | awk '{$1=$1}1' | pbcopy '


After opening a new window (or running source ~/.bash_profile) you should be able to run copyLastCmd and have the command in the clipboard.

To explain what's going on: you're basically using "fix command" (fc) to get you the last command, remove both leading and trailing whitespace for nicer formatting with awk and then copy it into your Mac's pasteboard with pbcopy.

EDIT:

Now that we know that you want to copy to paste into another terminal tab, there's another option:
Add these lines to your ~/.bashrc ~/.bash_profile or where-ever you like it:

shopt -s histappend
PROMPT_COMMAND='$PROMPT_COMMAND; history -a; history -n'


Then, once you have some new tabs open (let's call them "tab A" and "tab B"):


Execute any command in tab A
Switch to tab B, press enter on an empty line, giving you a "fresh" new line (and thus re-evaluating the history)
use the up arrow once and you should have the command you've just entered in tab A.


EDIT 2:
I've replaced the usage of sed with awk in the original answer above, to take care of both leading and trailing whitespace .