Linux: Set F2 F3 F4 to Cut Copy Paste

By Xah Lee. Date: . Last updated: .

This page shows you how to set {F2, F3, F4} keys to do {Cut, Copy, Paste} globally.

xvkbd is a virtual keyboard for X window system. It is useful as a shell command tool to send keys.

xbindkeys is a tool to let you bind keys to shell commands.

# install xvkbd
sudo apt-get install xvkbd
# install xbindkeys
sudo apt-get install xbindkeys

Xbindkeys Config File

Create a file at


Add the following content:

# ~/.xbindkeysrc

# make F2 do Ctrl+x
"xvkbd -no-jump-pointer -xsendevent -text '\Cx'"

# make F3 do Ctrl+c
"xvkbd -no-jump-pointer -xsendevent -text '\Cc'"

# make F4 do Ctrl+v
"xvkbd -no-jump-pointer -xsendevent -text '\Cv'"

# make F11 do Ctrl+PageUp
"xvkbd -no-jump-pointer -xsendevent -text '\C\[Prior]'"

# make F12 do Ctrl+PageDown
"xvkbd -no-jump-pointer -xsendevent -text '\C\[Next]'"

# make F14 do Ctrl+w
"xvkbd -no-jump-pointer -xsendevent -text '\Cw'"

Reload the Config File

Now, reload the config file.

# make xbindkeys reload config
killall -s1 xbindkeys

in case you need to restart it, do:

# restart xbindkeys daemon
killall xbindkeys
xbindkeys -f ~/.xbindkeysrc

xbindkeys tutorial

Linux: xbindkeys Tutorial

xvkbd tutorial

Linux: xvkbd tutorial

(thanks to XueFuqiao for help.)

Linux Keybinding How-to

  1. Keyboard Software Guide
  2. Swap Control Alt Keys
  3. Set F2 F3 F4 to Cut Copy Paste
  4. CapsLock → Escape
  5. CapsLock → Home
  6. Shift Lock
  7. Key to Switch App
  8. Key Repeat Rate
  9. System Keyboard Layout
  10. Switch Keyboard Layout
  11. Change Volume
  12. xmodmap
  13. xbindkeys
  14. xvkbd
  15. Find Keyboard Key Scancode
  16. X11 Keyboard Key Names
  17. 2 Layouts for 2 Keyboards
  18. Chinese Input Setup


  1. Mouse Hover to Auto-Raise Window
  2. Mouse Hover-Click
  3. Set Mouse Single-Click to Open File
  4. How to Set Mouse Speed
  5. How to Swap Mouse Buttons
  6. Set Trackball/Mouse Do Scroll
  7. Setup Accelerated Scroll and AutoScroll
  8. X11 Mouse Button Numbering

If you have a question, put $5 at patreon and message me.