Skip to content

Instantly share code, notes, and snippets.

@yiboyang
Last active February 21, 2024 18:21
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save yiboyang/b46a6ed848a2b83fb625 to your computer and use it in GitHub Desktop.
Save yiboyang/b46a6ed848a2b83fb625 to your computer and use it in GitHub Desktop.
A few xclip aliases to simplify copying/pasting
# to simplify life, install xclip and append the following lines to your .bashrc
alias "c=xclip" # copy to X clipboard (register *)
alias "cs=xclip -selection clipboard" # copy to system wide clipboard (register +)
alias "v=xclip -o" # output copied content (paste)
alias "vs=xclip -o -selection clipboard" # paste from system wide clipboard (equivalent to `v -selection clipboard`)
# examples:
# copy to X:
# go to the same directory in terminal 2 as in terminal 1
# Terminal 1:
# pwd | c
# Terminal 2:
# cd `v`
# copy to system clipboard:
# cat file1 | cs
# Then simply ctrl+(shift)+V to paste to X windows
# paste from systen clipboard on command line:
# vs > file1copy
@milovtim
Copy link

Great helpers.
For me c is too short for command name. I've put copy instead

@llijaz
Copy link

llijaz commented Jul 28, 2021

This is really useful 👍

@laoshaw
Copy link

laoshaw commented Feb 20, 2022

really cool tips. Thanks!!

@CLZRT
Copy link

CLZRT commented Oct 14, 2022

This is vary useful for me. Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment