Posts by alx
Use xclip(1). For example: $ printf '%s' foo | xclip; And now Shift+Insert to paste. There's a primary selection, a secondary selection, and a clipboard selection, and you can chose between t...
(Assuming your file names are portable, according to POSIX (https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282). If not, please read this for writing a more robust...
I wrote a filter program to overwrite each line with the next one. $ cat /usr/local/bin/ovr #!/bin/sh sed '2,$s/^/\x1B[1A\x1B[K/'; Here's the behavior: $ echo | ovr $ echo 'foo' | ovr ...
When an upstream project stops supporting a version (e.g., Python stops supporting 3.8), the maintainers of the distribution do the job of supporting those components, applying security patches as ...
In gpg(1), one normally adds recipients of an encrypted message with --recipient. Those recipients will be able to decrypt the message, and their key ID will appear unencrypted, so anyone will kno...
You could try and convince Linux kernel maintainers, but they are reticent to that. I wonder what they'll do after POSIX.1-202x (Issue 8) possibly will forbid those. Maybe you could patch your ke...
It depends on how much sensitive they are. I have three classes. 1) Very sensitive directories Partitions For my ~/.ssh/, ~/.password-store/, ~/.gnupg/, and ~/.abook/, I have a drive with 4 p...
The pager less(1) less(1) is the usual pager nowadays; you would do well learning to use it. It's also used for paging the manual pages, in most systems. The most common operation is searching,...
On Debian, the package manager can tell the versions of the installed software. Let's say we want to know the version of mbsync(1). Quoting a comment by @matthewsnyder, this is a 3 step process: ...
Neomutt (and probably Mutt too, but I didn't try) seems to be hiding header fields from email, such as the Message-ID field, and fields that are added by SMTP servers when they receive the message....
In some cases, when you want to apply a pipeline or a complex command to each file, I find it useful to use while read: find . -type d \ | while read d; do find $d -type f -maxdepth 1 \ | hea...
I'm trying to run a pipeline to update a PDF after every push to the 'main' branch. I want it to be atomic, so it doesn't touch the existing PDF until it has finished, so I need to use sponge(1) (...
With some pipes and apt-cache(8) search you can do it: $ apt-cache search libbsd | grep '^[^ ]*libbsd' | tr "\t" " " | sed 's/ -/\t-/' | column -t -s$'\t' | sort libbsd-arc4random-perl - CPAN's ...
A system daemon needs to create several files under /run/program-name/ (and possibly other subdirs of that). They are the PID file, and at least one Unix socket file (but maybe more). The FHS spe...
How can a file list be manually filtered with a gitignore file. I want to do the equivalent of git ls-files, but it should work even if I remove .git, so I can't use git(1). Currently, I'm doing ...
find . -type f -print0 \ | grep -z -- '-min.jpg-[[:alnum:]]*$' \ | while IFS= read -r -d '' f; do find "$f" -print0 \ | sed -z 's/-min.jpg-[[:alnum:]]*$/-min.jpg/' \ | xargs -0 mv ...
How can I rescale the Linux virtual terminals (ctrl + alt + {f1, f2, f3, f4, f5, f6}), so that a high-resolution display doesn't make the letters too small? I'd like to use 1080 or even 720 resolu...
Use nohup(1), and redirect stdout and stderr to /dev/null The following works as expected, not having to wait until the PDF is generated. #!/bin/sh test "$1" = "refs/heads/main" || exit 0; ...
This answer is not directly usable under Arch, since I don't know the tools there. I show you a way to do it on Debian, which may inspire you to find a similar way in Arch. With apt-file(1), you ...
Here's my approach: find l1 -type d \ | while read d; do find $d -maxdepth 1 -type f \ | head -n3; done; If your middle directories also contain files, it will also show them (of course, ...
Instead of having new stdout lines overwrite the previous one, it seems better to specify that old stdout lines should be overwritten by anything that comes after them. This has the benefit that s...
Unix filters are quite handy. First of all, you can get an index of any manual page with a simple grep(1): $ man pacman | grep '^[^ ]' PACMAN(8) Pacman Manual ...
There's no such feature. But it's easy to write. Apply this patch: From 8ea7d1cf4933ca24006308ac61aa50fb8ab33b02 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar <alx@kernel.org> Date: S...
I store my address book with abook(1). https://manpages.debian.org/bookworm/abook/abook.1.en.html Let's say I want to introduce some contact in some field that accepts the usual name <email>...