this post was submitted on 16 Dec 2025
165 points (98.2% liked)
Linux
60406 readers
477 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I think
vipeis underrated; it takes whatever is on its stdin, shoves it in a temp file, opens your favorite text editor (EDITORenvironment variable) and waits in the background until you finish editing the file and close it. Then it outputs the edited text to its stdout.It's useful in all kinds of pipes, but personally I use it tons of times a day in combination with
xclip, in something like this:(I actually have a bit fancier version of this pipe wrapped in a Bash function named
xvxx.)On my setup, this takes my current text selection, opens it in vim, and lets me edit it before it sends it to the "traditional" Ctrl+C clipboard. It's super handy for editing comments like this one.
If you often find yourself writing complex Bash pipelines involving generating some output and then running set of commands per line (perhaps in a
whileloop), sometimes replacing the "selection part" withvipecan be easier than coming up with right filter.And if you are really confident with Bash, you can go even a step further and do:
you might find something like this useful sometimes:
and just create a large dumb one-off script, manually curating what's exactly done. Remember that editing large lists in vim can be made much easier by utilizing vim's ability to invoke unix filter commands (those greps and uniqs and seds et al.) on the buffer, and /or block editing mode using
Ctrl+V(that last one method goes really well withcolumn -t).Neat! FYI for anoyone else who does not find this, it is part of moreutils.