I sometimes run a command like this to set the system clipboard, because I want to paste the result of whatevercommand into a text editor, terminal, or whatnot.

whatevercommand | xclip -selection c

But this uses the X clipboard, and if I'm on a remote system with no X, this won't work. Instead I often use tmux on remote systems.

So is there a similar command that I can use to set tmux's clipboard?

I'm thinking something like:

whatevercommand | tmux set-clipboard

1 Answer 1

echo aaaaaaaaaaaaaaaaa|tmux load-buffer -
  • Thanks! That was what I meant. Unfortunately I didn't think enough before asking, because I realized that what I actually wanted to do this time was to copy/paste between remote connections, where the remote machine is not running tmux. Oh well, that's another question maybe. Aug 22, 2019 at 12:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .