I'm sshing into ArchLinux machine from Ubuntu. I want to be able to copy some text from Ubuntu and paste it into a file in Archlinux from terminal. xclip doesn't work for me, because I'm unable to set up X. Any suggestions?

Ideally what I want to be able to do is what I do under Ubuntu:

xclip -o > file.txt

Except without using xclip

  • Doesn't merely your Ubuntu terminal support copy/paste? How are you ssh'ing ? – tonioc Aug 18 '15 at 10:45
  • @tonioc ssh user@host – Amir Aug 18 '15 at 11:08
  • sorry my question was maybe not clear enough: are you ssh'ing from Ubuntu graphical desktop? If so, the native copy/paste should be enough (it is for me in similar environments). – tonioc Aug 18 '15 at 11:15
  • You need to pass the -X (or -Y see the man page) option to ssh for ssh to forward the X11 connections so xclip on Arch can connect to your X11 display on Ubuntu and query the content of the selection there. – Stéphane Chazelas Aug 18 '15 at 11:50
  • @StéphaneChazelas yes, but the question us how to avoid using xclip – Amir Aug 18 '15 at 16:30

Maybe use scp that is used to transfer files ?

To log the command output (with errors):

command >> log 2>&1

And to get the log to your machine (execute it outside of ssh):

scp user@server:/path/to/log

I hope it will help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.