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 »

Search

Advanced Search Options

To further refine your search, you can use additional qualifiers such as score:>0.5. For example, the search score:>=0.5 created:<1y grammar would return only posts mentioning "grammar" that have a score >= 0.5 and were created less than a year ago.

Further help with searching is available in the help center.

Quick hints: tag:tagname, user:xxx, "exact phrase", post_type:xxx, created:<N{d,w,mo,y}, score:>=0.5

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

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

posted 7mo ago by matthewsnyder‭  ·  edited 7mo ago by matthewsnyder‭

Answer
50%
+0 −0
Q&A How to create systemd unit that depends on a website being up?

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

posted 7mo ago by Iizuki‭

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 7mo ago by alx‭  ·  edited 7mo 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 7mo ago by alx‭  ·  edited 7mo 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 7mo ago by alx‭  ·  edited 7mo ago by alx‭

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

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

posted 8mo ago by Kamil Maciorowski‭  ·  edited 7mo ago by Kamil Maciorowski‭

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 8mo ago by alx‭  ·  edited 8mo ago by alx‭

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

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/^\(....

posted 8mo ago by r~~‭  ·  edited 8mo ago by r~~‭

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

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

posted 8mo ago by r~~‭  ·  edited 7mo ago by r~~‭

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

MWE With the following tree: l1 └── l2 ├── d0 │   ├── f0 │   ├── f1 │   ├── f2 │   ├── f3 │   ├── f4 │   └── f5 ├── d1 │   ├── f0 │   ├── f1 ...

3 answers  ·  posted 8mo ago by mcp‭  ·  last activity 7mo ago by matthewsnyder‭

Question bash zsh ls find cp
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 8mo ago by alx‭  ·  last activity 7mo ago by Kamil Maciorowski‭

Question terminal
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 8mo ago by alx‭  ·  edited 8mo 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 8mo ago by alx‭  ·  last activity 8mo ago by alx‭

Question abook mailto
80%
+6 −0
Q&A How does the root user locate executables?

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

posted 8mo ago by r~~‭

Answer
60%
+1 −0
Q&A How does the root user locate executables?

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

1 answer  ·  posted 8mo ago by Karl Knechtel‭  ·  last activity 8mo ago by r~~‭

Question path which root-user
75%
+4 −0
Q&A Higher-order functions in Bash?

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

posted 8mo ago by Kamil Maciorowski‭  ·  edited 8mo ago by Kamil Maciorowski‭

Answer
66%
+2 −0
Q&A Higher-order functions in Bash?

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

1 answer  ·  posted 8mo ago by Karl Knechtel‭  ·  last activity 8mo ago by Kamil Maciorowski‭

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

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

1 answer  ·  posted 8mo ago by ShadowsRanger‭  ·  last activity 7mo ago by alx‭

Question arch-linux packages
66%
+2 −0
Q&A Why does $XDG_DATA_HOME default to ~/.local/share?

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

posted 8mo ago by r~~‭

Answer
50%
+0 −0
Q&A Nvidia docker runtime: Failed to create task for container

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

posted 8mo ago by matthewsnyder‭

Answer
60%
+1 −0
Q&A Why does $XDG_DATA_HOME default to ~/.local/share?

Why does XDG_DATA_HOME default to ~/.local/share? Why not something less cryptic, like ~/.data? Why did they decide use that path?

1 answer  ·  posted 8mo ago by matthewsnyder‭  ·  last activity 8mo ago by r~~‭

Question xdg
66%
+2 −0
Q&A How can I get a Flatpak dependency graph?

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

0 answers  ·  posted 8mo ago by Karl Knechtel‭

71%
+3 −0
Q&A How to see all header fields of an email in mutt?

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

posted 8mo ago by Canina‭

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 8mo ago by alx‭  ·  edited 8mo ago by matthewsnyder‭

Question neomutt mutt
50%
+1 −1
Q&A What are the concrete security risks of forcibly terminating a process?

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

posted 8mo ago by matthewsnyder‭

Answer