Top
In this article I'm going to share a simple bash function that makes dealing with system clipboard easier on linux:
You need to install
Usage
-
It automatically determines whether it's supposed to output the current clipboard or overwrite the clipboard based on its location in the pipeline:
clb | rg '^//' # Search clipboard for comments cat program.cc | rg '^//' | clb # Copy all comments in a file clb | sed 's/C++/Rust/g' | clb # modify clipboard contents -
It will open the clipboard content in your
EDITOR if invoked asclb e . Clipboard will be updated when you exit the editor.