Copy file to xclip and paste to Firefox

X11 has several available clipboards. By default, xclip places data in the primary selection buffer. To paste it, you use middle-click.

If you want to use Ctrl+v, use xclip -selection clipboard. See man xclip for more information.

There is good information about the different clipboards on freedesktop.org.


Copy to your clipboard with:

xclip -sel clip < ~/path/to/file.txt

and then paste CTRL + V wherever you wish to.


Add this to to your ~/.bashrc

# now `cclip' can be used when you it to be available to `ctrl-[vxc]'
alias cclip='xclip -selection clipboard'

alternatively, run this:

echo 'alias cclip='"'"'xclip -selection clipboard'"'" >> ~/.bashrc