Search
There's three parts to this: Find all directories (in your case, sounds like you want depth=3 only) Print the top 3 files in a single directory Apply 2 to each in 1 1 should be a separate q...
To make your example work, you should add Type=oneshot and RemainAfterExit=true to the [Service] section. This way the unit won't be considered active until the curl has actually succeeded, and ei...
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...
This other answer tries to truncate each line to make it fit the width of the terminal. It's hard to do this reliably because e.g. a tab character counts as one, but it looks like several spaces; o...
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 ...
In Bash, you could use the $COLUMNS environment variable to detect the width of your terminal and truncate each line to that length in your sed script. Something like this should work: sed "s/^\(....
Is this what you want? Edit: Credit to Kamil Maciorowski for catching an unsafe interpolation in the previous draft; it will work for non-adversarial inputs but this newer version is safer and a ...
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 ...
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>...
but it clearly does see that change. Nope. Your environment is being reloaded in the sudo process. sudo echo $PATH gives the same result as echo $PATH because $PATH is expanded by your shell ...
A little while ago I was helping someone with running Python in a virtual environment, as root, for some specific purpose. I determined easily enough that this requires explicitly specifying the pa...
Do not embed {} in the shell code. If your {} gets expanded (by xargs) to ./rogue name $(reboot).txt then bash -c 'my-func "{}"' _ will become bash -c 'my-func "./rogue name $(reboot).txt"' _ a...
Say I have some Bash function my-func, that expects a filename and does some processing on the corresponding file. For demonstration purposes, my-func() { cat "$1"; } If I want to apply that fu...
I want to generate a list of trending Arch/AUR packages that focuses on user-facing applications rather than background libraries and dependencies. I wrote a script that uses the data from pkgstat...
I wasn't there two decades ago when the spec was first being developed, but based on other parts of the spec they're clearly attempting to establish a parallel with /usr/local. The intended minimal...
I found a partial fix. You have to run: sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml After this, podman is able to run it: sudo podman run --rm --device nvidia.com/gpu=all ubuntu...
Why does XDG_DATA_HOME default to ~/.local/share? Why not something less cryptic, like ~/.data? Why did they decide use that path?
flatpak uninstall --unused currently tells me that there is Nothing unused to uninstall. This seems wrong to me, based on the list of packages I see vs. the "root" packages I explicitly installed p...
When viewing a message, press h. To return to the normal view, press h again. With typical viewer key bindings, h is bound to the display-toggle-weed function, which controls whether all headers a...
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....
That sounds like bad design on the developers' part. There are many unavoidable ways a program may be terminated unexpectedly: Killed by an OOM killer Program crash Terminated by virus OS cra...