Ubuntu – How to copy many files to clipboard from the command line

clipboardcommand line

Suppose you have different files in a directory: one.txt, two.jpg, three.pdf, four.jpg etc. You want to copy them all to clipboard from the command line. Something like copyclipboard *. How do you do it?

Based on this answer, which solves for a particular case, but has the filetype hardcoded in the script. I wonder if there is a more general solution.

Best Answer

Is this to speed up some workflow you have or for some script?

What I usually do is that when I enter the folder with the files I want to copy I run nautilus . to get the file browser. The workflow problem I see with copying straight from terminal is that you still need to browse to the folder where you want to paste the files later on.

Please comment if I'm missing something here.