Small shell function to copy last line in shell history to clipboard:
# Copy last command from shell history into clipboard
function cl() {
fc -ln | tail -1 | tr --delete "\n" | xclip -selection clipboard
}
Mega useful when you have multiple terminals open, or you want to paste it into documentation.