Copy, Cut And Paste On The Command Line With Clipboard

Clipboard command line tool

Clipboard is a new command line tool to cut, copy and paste text, files and folders. The software works on Linux, Windows, macOS, Android and *BSD.

This tiny yet powerful command line utility can be useful to both new and power users. Besides allowing you to cut, copy and paste anything from a terminal, it can show the clipboard contents, clear the clipboard, and there's also support for multiple (infinite) clipboards.

What's more, the tool was updated recently with GUI support, meaning you can copy something from the terminal and paste it into a GUI application – this works on Linux (with a recent update, both X11 and Wayland are supported), Windows and macOS.

Even though Clipboard had its first public release recently (November 2022), it's already quite feature-ready. Besides the features I've already mentioned, it also includes a progress bar, and various configuration options that allow always using persistent clipboards, change the color, set the temporary directory path, and more.

You might also like: Is An Interactive Terminal Theme Selection Script (400+ Themes)

Using Clipboard is as straightforward as it gets:

cb copy file1.txt file2.ogv folder1

✓ Copied 2 files and 1 directories

cd ..

cb paste

• The item file2.ogv already exists here. Would you like to replace it? Add all or a to use this decision for all items. [(y)es/(n)o)] y

✓ Pasted 2 files and 1 directories

See its help for a complete list of available commands and configuration options (--help).

How to install Clipboard

Clipboard, the command line clipboard utility, can be installed on Arch Linux / Manjaro from AUR: clipboard-bin or clipboard packages.

For other Linux distributions, Windows and macOS, you can use the script provided by the Clipboard developer to install this. Using the script did not work for me though.

There are also Clipboard binaries available for download, for Linux, macOS, and Windows.

To install the binary on Linux into /usr/local/bin, download it from the GitHub releases page and extract the zip. Next, open a terminal and navigate to the folder where you've extracted the binary (e.g. clipboard-linux-amd64/), and there, run this command in the terminal:

sudo install bin/clipboard /usr/local/bin/cb

This installs Clipboard as cb, so you have to type less when using it. Or just copy the clipboard binary somewhere in your PATH, like /usr/local/bin or ~/.local/bin, and make it executable.

You might also like: How To Run A Command After The Previous One Has Finished On Linux

via r/linux