Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Posts by alx‭

24 posts
77%
+5 −0
Q&A How do I send console output to the clipboard?

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...

posted 6mo ago by alx‭  ·  edited 6mo ago by alx‭

Answer
75%
+4 −0
Q&A How to extract string from file, run filter, and replace in file with new value?

(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...

posted 12mo ago by alx‭  ·  edited 12mo ago by alx‭

Answer
71%
+3 −0
Q&A How to overwrite each line of STDOUT with the next one?

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 ...

3 answers  ·  posted 1y ago by alx‭  ·  last activity 1y ago by Kamil Maciorowski‭

Question terminal
71%
+3 −0
Q&A Why/how can distro support lifetimes exceed the lifetime of their dependencies (such as Python)?

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 ...

posted 8mo ago by alx‭  ·  edited 8mo ago by alx‭

Answer
71%
+3 −0
Q&A Can a malicious party add false recipients (who are listed but can't really decrypt) to an encrypted GPG message?

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...

0 answers  ·  posted 8mo ago by alx‭  ·  edited 8mo ago by alx‭

Question GPG
71%
+3 −0
Q&A How can I restrict filename characters?

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...

posted 1y ago by alx‭  ·  edited 1y ago by alx‭

Answer
71%
+3 −0
Q&A Looking for a way to sync dotfile content between different machines without introducing security issues

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...

posted 1y ago by alx‭  ·  edited 11mo ago by alx‭

Answer
71%
+3 −0
Q&A How to RTFM well to get a CLI command

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,...

posted 1y ago by alx‭  ·  edited 1y ago by alx‭

Answer
70%
+5 −1
Q&A How do I find out the version of a program in a terminal?

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: ...

posted 6mo ago by alx‭  ·  edited 5mo ago by alx‭

Answer
66%
+2 −0
Q&A How to see all header fields of an email in mutt?

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....

1 answer  ·  posted 1y ago by alx‭  ·  edited 1y ago by matthewsnyder‭

Question neomutt mutt
66%
+2 −0
Q&A How to run a command on a list of files?

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...

posted 1y ago by alx‭  ·  edited 1y ago by alx‭

Answer
66%
+2 −0
Q&A Run pipeline in the background from git hook

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) (...

1 answer  ·  posted 12mo ago by alx‭  ·  last activity 12mo ago by alx‭

Question shell-scripting git
60%
+1 −0
Q&A How do I customize the output format of `apt search`?

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 ...

posted 4mo ago by alx‭  ·  edited 4mo ago by alx‭

Answer
60%
+1 −0
Q&A Who creates subdirs under `/run`?

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...

1 answer  ·  posted 2y ago by alx‭  ·  edited 2y ago by alx‭

Question unix /run
60%
+1 −0
Q&A How to use the gitignore file without git(1).

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 ...

1 answer  ·  posted 9mo ago by alx‭  ·  last activity 9mo ago by r~~‭

60%
+1 −0
Q&A Rename multiple files which have a variable suffix

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 ...

posted 1y ago by alx‭  ·  edited 1y ago by alx‭

Answer
57%
+2 −1
Q&A How to change resolution of virtual terminal?

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...

2 answers  ·  posted 1y ago by alx‭  ·  last activity 1y ago by Canina‭

50%
+0 −0
Q&A Run pipeline in the background from git hook

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; ...

posted 12mo ago by alx‭  ·  edited 12mo ago by alx‭

Answer
50%
+0 −0
Q&A How to identify and separate standalone applications from libraries in Linux package lists?

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 ...

posted 1y ago by alx‭  ·  edited 1y ago by alx‭

Answer
50%
+0 −0
Q&A How to list the first x files in each directory

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, ...

posted 1y ago by alx‭  ·  edited 1y ago by alx‭

Answer
50%
+0 −0
Q&A How to overwrite each line of STDOUT with the next one?

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...

posted 1y ago by alx‭  ·  edited 1y ago by alx‭

Answer
50%
+0 −0
Q&A Ergonomic way to search man pages

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 ...

posted 1y ago by alx‭  ·  edited 1y ago by alx‭

Answer
50%
+0 −0
Q&A How to get a mailto: URI out of abook(1)

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...

posted 1y ago by alx‭  ·  edited 1y ago by alx‭

Answer
50%
+0 −0
Q&A How to get a mailto: URI out of abook(1)

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&gt...

1 answer  ·  posted 1y ago by alx‭  ·  last activity 1y ago by alx‭

Question abook mailto