I’ve been setting up a new Proxmox server and messing around with VMs, and wanted to know what kind of useful commands I’m missing out on. Bonus points for a little explainer.
Journalctl | grep -C 10 'foo' was useful for me when I needed to troubleshoot some fstab mount fuckery on boot. It pipes Journalctl (boot logs) into grep to find ‘foo’, and prints 10 lines before and after each instance of ‘foo’.


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.