🖥️xsel

➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the xsel command with important options and switches using examples.

▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁

#  ██╗  ██╗███████╗███████╗██╗
#  ╚██╗██╔╝██╔════╝██╔════╝██║
#   ╚███╔╝ ███████╗█████╗  ██║
#   ██╔██╗ ╚════██║██╔══╝  ██║
#  ██╔╝ ██╗███████║███████╗███████╗
#  ╚═╝  ╚═╝╚══════╝╚══════╝╚══════╝

# X11 selection and clipboard manipulation tool.

# Use a command's output as input of the clip[b]oard (equivalent to Ctrl + C):
echo 123 | xsel -ib

# Use the contents of a file as input of the clipboard:
cat file | xsel -ib

# Output the clipboard's contents into the terminal (equivalent to Ctrl + V):
xsel -ob

# Output the clipboard's contents into a file:
xsel -ob > file

# Clear the clipboard:
xsel -cb

# Output the X11 primary selection's contents into the terminal (equivalent to a mouse middle-click):
xsel -op

xsel | nl | grep [email protected] 
# Paste a list of email addresses and number them and show the entry for a specific address.

xsel -b | sed 's/2018/2019/g' | xsel -b 
# Replace all instances of 2013 with 2014 in your X windows copy buffer.

# Take the text in your select/copy buffer (Xwin or Mac) and sort it then print unique lines with a "count of duplicates" prior to the line.
{ xsel || pbpaste; } | sort | uniq -c 
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░