| CARVIEW |
Select Language
HTTP/2 200
date: Mon, 29 Dec 2025 09:20:35 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"78f0bcf845b07a093bbff504036a528f"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com marketplace-screenshots.githubusercontent.com/ copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com github.githubassets.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=I1XsMVT09J9lq8qfr%2FCZtYIQBREqT8TY4Ua9r8o56mv6uK%2BQTXIpuKeAvvcuG5ADIODUYf%2FtPBIz6GVF3bGR7L2xdW%2FRLvI0hWGLKnX3M%2BE4iLNT8%2BTxyyPm3FZSeixwKqlmoxfg67B7%2BOAJ7NGTKIsCXYTeZOI8xJuKil6IThySRv66e2N7AGMSG4cLnmJAU%2F7fgSRx%2FFxFH8ARFaoE9XbNcTTpHIk%2BmyohxZ3NWsFfqjeJus%2BPiRv4TRyAmMnStnUPUtmux3FxV%2FfG%2BgkOUw%3D%3D--%2BQsEz%2FCP8ttp%2FR49--0yGGEkbv4GJ2Dcym1NvnHg%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1007142564.1767000035; Path=/; Domain=github.com; Expires=Tue, 29 Dec 2026 09:20:35 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Tue, 29 Dec 2026 09:20:35 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: A81E:13ACF:5CE7459:6FF9556:695247E3
GitHub - astrand/xclip: Command line interface to the X11 clipboard
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 77
Command line interface to the X11 clipboard
License
astrand/xclip
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
WHAT IS XCLIP?
==============
xclip is a command line utility that is designed to run on any system with an
X11 implementation. It provides an interface to X selections ("the clipboard")
from the command line. It can read data from standard in or a file and place it
in an X selection for pasting into other X applications. xclip can also print
an X selection to standard out, which can then be redirected to a file or
another program.
USING XCLIP
===========
Here are some ideas for things you can do with xclip:
Copy your uptime into the selection for pasting:
uptime | xclip
Copy your password file for pasting:
xclip /etc/passwd
Save some text you have Edit | Copied in a web browser:
xclip -o -sel clip > webpage.txt
Open a URL selected in an email client
mozilla `xclip -o`
Copy XA_PRIMARY to XA_CLIPBOARD
xclip -o | xclip -sel clip
In command mode in vim, select some lines of text, then press shift-:
for an ex prompt, and use this command to copy the selected lines of
text to the primary X selection:
!xclip -f
USING XCLIP FOR MOVING FILES
============================
The programs xclip-copyfile, xclip-pastefile, and xclip-cutfile can be
used for copying and moving files between different directories and
even machines, assuming that you have a working X11 connection. Here
are some examples:
# Copying a file to a remote host
[maggie.lkpg.cendio.se ~]$ echo "A file created on ${HOSTNAME}" > file1
[maggie.lkpg.cendio.se ~]$ xclip-copyfile file1
[sofie.homeip.net ~/doc]$ xclip-pastefile
file1
[sofie.homeip.net ~/doc]$ cat file1
A file created on maggie.lkpg.cendio.se
# Copying an entire tree structure
[sofie.homeip.net ~]$ xclip-copyfile doc
[maggie.lkpg.cendio.se ~/tmp]$ xclip-pastefile
doc/
doc/letter-mom-april.txt
doc/file1
doc/letter-dad-march.txt
# Copying files with preserved path information
[maggie.lkpg.cendio.se ~]$ xclip-copyfile -p /etc/sysconfig/grub
tar: Removing leading `/' from member names
[sofie.homeip.net ~/tmp]$ xclip-pastefile
etc/sysconfig/grub
[sofie.homeip.net ~/tmp]$ ls etc/sysconfig/grub
etc/sysconfig/grub
# Moving files
[sofie.homeip.net ~]$ ls letter-brother-may.txt
letter-brother-may.txt
[sofie.homeip.net ~]$ xclip-cutfile letter-brother-may.txt
[sofie.homeip.net ~]$ ls letter-brother-may.txt
ls: cannot access letter-brother-may.txt: No such file or directory
[sofie.homeip.net ~]$ cd doc
[sofie.homeip.net ~/doc]$ xclip-pastefile
letter-brother-may.txt
FEATURES
========
* Reads data piped to standard in or files given as arguments
* Prints contents of selection to standard out
* Accesses the XA_PRIMARY, XA_SECONDARY or XA_CLIPBOARD selection
* Accesses the cut-buffers
* Supports the INCR mechanism for large transfers
* Connects to the X display in $DISPLAY, or specified with -display host:0
* Waits for selection requests in the background
SELECTIONS
==========
For a good overview of what selections are about, have a look at
<https://specifications.freedesktop.org/clipboards-spec/clipboards-latest.txt>. Short version:
* XA_PRIMARY contains the last text you highlighted
* Middle click pastes XA_PRIMARY
* XA_CLIPBOARD contains text explicitly copied with Edit | Copy, Ctrl-C etc.
* Edit | Paste pastes XA_CLIPBOARD
* xclip uses XA_PRIMARY unless you specify otherwise with -selection
CAN I HELP?
===========
Glad you asked! At this stage, I'm pretty happy with the features and
implementation, so if you have anything at all that should be done, I want to
hear about it. Doesn't matter how small, compiler warnings, segfaults, spelling
mistakes, whatever, I want to get it sorted out. xclip is not a big project,
I'd like to get all these things sorted out and then declare it "complete".
LICENSE
=======
GNU GPL, see the COPYING file for details.
CONTACT
=======
Web:
https://github.com/astrand/xclip
Email:
astrand@lysator.liu.se
Please email me about problems, experiences, patches, fixes, etc.
About
Command line interface to the X11 clipboard
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published
You can’t perform that action at this time.