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 »
Q&A

General Q&A about Linux and Unix-like operating systems

Filters (None)
86%
+11 −0
In a bash shell script, how to filter the command line argument list to unique entries only, for processing each?

I have a handful of shell scripts that accept any number of command line arguments, then do some relatively expensive processing based on each command line argument in turn. The general format for ...

3 answers  ·  posted 2y ago by Canina‭  ·  last activity 2y ago by Quasímodo‭

84%
+9 −0
What are phased updates, and why does Ubuntu use them?

So I ran into that weird "packages being held back" problem while updating my system using apt. After some research, it appears to be the result of "phased updates". What are phased updates, any...

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

83%
+8 −0
Are there any legitimate uses for newlines in filenames?

Unix is very permissive with filenames, and this can sometimes lead to a bunch of annoying corner cases when printing files. A well known example is when you put a newline in a filename, and it bre...

2 answers  ·  posted 10mo ago by matthewsnyder‭  ·  last activity 10mo ago by terdon‭

81%
+7 −0
How to get number of files in directory

How do you find out the number of files in a directory from the command line?

4 answers  ·  posted 1y ago by mcp‭  ·  last activity 10mo ago by AdminBee‭

81%
+7 −0
What does a minimal /etc/hosts need to contain?

I run an environment that, until recently, did all local name resolution by putting names in /etc/hosts. I'm in the process of replacing that with local DNS. The DNS part works fine, and now I'm tr...

1 answer  ·  posted 2y ago by ajv‭  ·  last activity 2y ago by dsr‭

81%
+7 −0
What partition type should be used for cross-platform FAT partitions?

Question What partition type should I use for FAT partitions such that Linux and Windows systems both recognize the drive? Notes I am partitioning the drive with fdisk and making the filesystem ...

1 answer  ·  posted 1y ago by mcp‭  ·  last activity 1y ago by Ullallulloo‭

80%
+6 −0
Does /proc/config.gz always contain all supported options of a kernel?

Assuming I have a running Linux system that has the /proc/config.gz file: Does the (unpacked) file always contain all of the options the particular kernel supports, including commented out like: ...

1 answer  ·  posted 2y ago by sktpin‭  ·  edited 1y ago by Quasímodo‭

80%
+6 −0
How do I deal with a "pending update to "snap-store" snap, close the app to avoid disruption" notification in Ubuntu 22.04?

For several days now, I've been getting a notification telling me that there's a pending update to the "snap-store", and to close the app to avoid disruption. I first got this notification while...

1 answer  ·  posted 1y ago by Mithical‭  ·  last activity 1y ago by Quasímodo‭

80%
+6 −0
Why is Pause/Break key is immediately released? Can that be fixed?

Since the Pause key is useless, I tried to map it to a modifier key. What is straightforward for other keys turned out not to work fine for Pause. By inspecting the output of xev -event keyboard |...

1 answer  ·  posted 2y ago by Quasímodo‭  ·  last activity 2y ago by Quasímodo‭

80%
+6 −0
How to forward SSH access of one machine, through another, to the rest of a network?

I have a setup with two Raspberry PIs, a CM3 module with only a USB connection to the outside, and the Pi4 with a lot of connectors. I set up things such that CM3 functions as USB Gadget, and once...

3 answers  ·  posted 3y ago by CanisSomnolentus‭  ·  last activity 2mo ago by Michael‭

80%
+6 −0
A shell script that can run under different shells

I have a shell script with a syntax compatible to both bash and zsh, except for a section that has zsh specific syntax that throws syntax errors if sourced from bash. Is there an easy way to escap...

2 answers  ·  posted 2y ago by 4015.alt‭  ·  last activity 2y ago by mjy‭

80%
+6 −0
Looking for a way to sync dotfile content between different machines without introducing security issues

I switch between three computers and have never been able to keep my dotfiles in sync. I cannot put them into source control because they contain sensitive data. So, my question is: how do I share ...

3 answers  ·  posted 5mo ago by paulsweatte‭  ·  last activity 4mo ago by matthewsnyder‭

80%
+6 −0
How do I view fonts?

How can I view font files, like .ttf, in Linux? I'd like to see a sample of the font (quick brown fox...) and metadata about it (like exact name).

2 answers  ·  posted 10mo ago by matthewsnyder‭  ·  last activity 10mo ago by andrew.46‭

80%
+6 −0
How to RTFM well to get a CLI command

I've been met with the phrase RTFM often. I recognize its value. However, the manual pages are often hard to understand and written by people who know so much about the topic at hand that they don'...

2 answers  ·  posted 5mo ago by LAFK‭  ·  last activity 4mo ago by matthewsnyder‭

80%
+6 −0
What are the correct permissions for `~/.ssh/config`?

I got this message: Bad owner or permissions on /Users/rbiaa065/.ssh/config What should the permissions be to make ssh happy?

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

ssh
77%
+5 −0
How can I restrict filename characters?

Suppose I want to limit what characters are allowed in filenames. For example, I want file creation to fail if there is a \n in the name. Is there a way to enforce this? If it matters, I prefer a...

2 answers  ·  posted 6mo ago by matthewsnyder‭  ·  last activity 6mo ago by Basile Starynkevitch‭

77%
+5 −0
Copy to clipboard from terminal with Vim bindings

Question How do I copy to clipboard from terminal with yy, assuming it's configured to use Vim bindings? I am using zsh with bindkey -v. MWE Enter something on the commandline (without pressi...

2 answers  ·  posted 1y ago by mcp‭  ·  last activity 8mo ago by Mithical‭

77%
+5 −0
How to convert Flac to Mp3 with FFmpeg?

I have a directory filled with Flac audio files and I would like to convert them all to Mp3. How do I go about this using FFmpeg? I am using the git FFmpeg and Slackware -current.

2 answers  ·  posted 11mo ago by andrew.46‭  ·  last activity 10mo ago by matthewsnyder‭

77%
+5 −0
What are the concrete security risks of forcibly terminating a process?

I'm using the Gnome System Monitor in Linux Mint. Whenever I attempt to "End" or "Kill" a process, I am given this warning via a modal dialog (emphasis mine): Killing a process may destroy data,...

2 answers  ·  posted 7mo ago by Karl Knechtel‭  ·  last activity 9d ago by Kamil Maciorowski‭

77%
+5 −0
What is cat abuse/useless use of cat?

Sometimes I share Unix commands online, and people chastise me for "useless use of cat" (UUOC) or "cat abuse". My cat is quite comfy and doing very well, thank you. What are they talking about?

3 answers  ·  posted 27d ago by matthewsnyder‭  ·  last activity 17d ago by Canina‭

cli
77%
+5 −0
What unexpected things can happen if a user runs commands expecting a text file on input lacking a file-final newline?

It is often taught that in Unix/Linux text files should end with newline characters. The reason given (orally) to me by various sources was that "some commands (such as wc) assume or require a newl...

2 answers  ·  posted 10mo ago by Lover of Structure‭  ·  last activity 9mo ago by tripleee‭

77%
+5 −0
Adding Python 3.11 to `$PATH`

I built Python 3.11 from source (from GitHub python/cpython branch "3.11"). Here is what I did (after downloading the repo as ZIP) cd Downloads 7z x cpython-3.11.zip cd cpython-3.11 chmod +x c...

2 answers  ·  posted 1y ago by HGStyle‭  ·  last activity 10mo ago by terdon‭

77%
+5 −0
Reverse shell with named pipe and netcat

This blog post describes a privilege escalation, exploiting tar's --checkpoint-action option. The privilege escalation is used to solve a TryHackMe challenge. The root user calls tar via cron whi...

1 answer  ·  posted 2y ago by Matthias Braun‭  ·  last activity 10mo ago by Kamil Maciorowski‭

77%
+5 −0
How to figure out the licenses of files installed from packages?

On a Linux system, a lot of files are installed from packages, many of which have different licenses (and sometimes different licenses for different files in the package). If I want to figure out ...

1 answer  ·  posted 2y ago by celtschk‭  ·  last activity 2y ago by Quasímodo‭

77%
+5 −0
Installing Ruby on MacOS 12.2 (or 11.6) produces compilation errors in the downloaded source; how do I fix?

A project I want to work on requires Ruby. I was directed to RVM or rbenv. I tried rbenv first because it has Mac instructions, ran into failures, uninstalled it and installed RVM, and still ran ...

1 answer  ·  posted 2y ago by Monica Cellio‭  ·  edited 2y ago by Monica Cellio‭

77%
+5 −0
How do I safely replace brew on Big Sur?

I'm still trying to solve my problem with installing Ruby on a new Mac, and some discussions are saying that I need to reinstall brew because of the change from the old chipset to the M1. (I'm jus...

4 answers  ·  posted 2y ago by Monica Cellio‭  ·  last activity 3mo ago by matthewsnyder‭

77%
+5 −0
Recursively remove files with the same name as the ones that end in `.part`

I want to remove all files with the ".part" extension in the current directory and its subdirectories, including files with the same name but different extension. Is this correct? find . -name '*...

3 answers  ·  posted 1y ago by ShadowsRanger‭  ·  last activity 10mo ago by jimbobmcgee‭

77%
+5 −0
Capture separate _and_ combined stdout/stderr

Using BASH, how can I redirect stdout and stderr each, to two separate files, simultaneously? That's a mouthful, let me clarify a little: I have a hypothetical script that may/will generate outpu...

1 answer  ·  posted 2y ago by jaybeers‭  ·  last activity 2y ago by Quasímodo‭

75%
+4 −0
How to convert PDF to docx

How can I convert PDF to docx using the terminal or a Linux app? The output docx must be formatted with editable text. Some alternative solutions I've seen online using soffice and abiword output...

2 answers  ·  posted 1y ago by mcp‭  ·  last activity 1y ago by samcarter‭

75%
+4 −0
How to configure GNOME Keyring to by default NOT automatically unlock keyrings whenever logged in, on Debian?

On a Debian Buster system I use, the password for connecting to a VPN is stored in the GNOME Keyring. Therefore, whenever I want to connect to the VPN in question, I get prompted to unlock my keyri...

1 answer  ·  posted 3y ago by Canina‭  ·  edited 3y ago by deleted user

75%
+4 −0
When should you install windows dlls for wine with winetricks?

I noticed in winetricks that it can install windows dlls to the wine folder. It even gives an option to install almost all of them at once. When should someone install these instead of staying with...

2 answers  ·  posted 1y ago by true_blue‭  ·  last activity 10mo ago by matthewsnyder‭

75%
+4 −0
Desktop Multiplexer for Linux? (GNU Screen for GUI apps)

GNU Screen and Tmux allow you to run command-line programs on a server, and 'disconnect' from them but let them keep running remotely. This is great if your primary computer is a laptop and it has...

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

75%
+4 −0
Retrieve changes that closed a Debian bug

If a Debian bug number is referenced in the changelog of an uploaded package, it is automatically closed with a generic message: We believe that the bug you reported is fixed in the latest versi...

2 answers  ·  posted 1y ago by Quasímodo‭  ·  last activity 10mo ago by tripleee‭

75%
+4 −0
What is the best way to identify changes from the default configuration in Raspbian systems?

I've got a Raspberry Pi running Raspbian, which I'd like to reinstall from scratch. However over time I've made many changes to the configuration (installed new packages, changed the name of the de...

1 answer  ·  posted 3y ago by celtschk‭  ·  last activity 3y ago by Canina‭

75%
+4 −0
Make Less use a normal view instead of hexdump view

Less does not display data files normally, but if it were some sort of Xxd. $ bash --norc $ export LESS= $ file -i /var/log/lastlog /var/log/lastlog: application/octet-stream; charset=binary $...

1 answer  ·  posted 2y ago by Quasímodo‭  ·  edited 2y ago by Quasímodo‭

75%
+4 −0
VISUAL=gvim makes crontab -e open a new crontab instead of a current one

My VISUAL setup interferes with my cron jobs. crontab -l works all right, I see my previous jobs. crontab -e, crontab -e -u user-here - opens GVIM on an empty file checked cron.allow or .deny,...

1 answer  ·  posted 5mo ago by LAFK‭  ·  last activity 5mo ago by Quasímodo‭

75%
+4 −0
How to run a command on a list of files?

Suppose I have a list of files on standard input. These may be the output of find, cat filelist.txt or something else. How can I run a command on each file in turn?

5 answers  ·  posted 10mo ago by matthewsnyder‭  ·  last activity 18d ago by trueframe‭

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

TASK I am coding up ebooks to a specific standard, and have a script that converts a string into the correct titlecase for this publisher. When working with some public domain source files, one of...

4 answers  ·  posted 5mo ago by David‭  ·  last activity 1mo ago by Mithical‭

75%
+4 −0
How do I tweak the start parameters of GUI apps?

There are many GUI apps on my computer that show up as eg. items in the start menu. When I launch these, what if I want to control how exactly they are launched, such as setting environment variabl...

1 answer  ·  posted 7mo ago by matthewsnyder‭  ·  last activity 7mo ago by matthewsnyder‭

75%
+4 −0
Documentation for double asterisk glob expansion

Where can I find documentation on double asterisk in glob expansion? It is discussed in the .gitignore section of Pro Git. It works in ls **/* to list all terminal files. It is supported by py...

2 answers  ·  posted 8mo ago by mcp‭  ·  last activity 8mo ago by Kamil Maciorowski‭

75%
+4 −0
Can I enter raw strings in fish to avoid escaping regexes for sed?

When running sed through fish, I often encounter a problem with regexes. Many commonly used regex control characters like []{}().+ need to be escaped, even if I type the regex in a single quoted st...

2 answers  ·  posted 10mo ago by matthewsnyder‭  ·  last activity 10mo ago by terdon‭

75%
+4 −0
How can I use SIGUSR1 or SIGUSR2 without risk of terminating the process?

SIGUSR1 and SIGUSR2 are user-defined signals. Imagine there is a tool designed to do something useful upon receiving one or the other. The problem is the default action for these signals is Term (...

1 answer  ·  posted 10mo ago by Kamil Maciorowski‭  ·  last activity 10mo ago by Kamil Maciorowski‭

75%
+4 −0
What's the point of faillock?

On a default Arch install, faillock makes it so that if you enter the sudo password wrong too many times, even the correct password will be rejected until the timer is up. At the same time, you ca...

0 answers  ·  posted 2mo ago by matthewsnyder‭

75%
+4 −0
Debug NetworkManager with GDB

I'd like to debug NetworkManager by stepping through it using GDB. I assume I'll have to compile NetworkManager from source to get debug symbols since file /usr/bin/NetworkManager indicates that th...

1 answer  ·  posted 10mo ago by Matthias Braun‭  ·  last activity 4mo ago by Matthias Braun‭

72%
+6 −1
How do I get lubuntu to not prompt non-admins about updates?

I have an old Mac Mini (Late 2009 model) kicking around, and as Apple stopped providing patches for it (and as I'm not going to put an unpatched system on the Internet), I was looking for a Linux d...

1 answer  ·  posted 3y ago by Peter Cooper Jr.‭  ·  last activity 3y ago by deleted user

71%
+3 −0
how to determine from the command line whether a DVD is encrypted

I am currently ripping a bunch of DVDs. Some are encrypted, and some are not. My method for ripping a DVD depends on whether or not it is encrypted, so I am looking for a command-line method to det...

0 answers  ·  posted 2y ago by Trevor‭  ·  last activity 8mo ago by Mithical‭

dvd
71%
+3 −0
Can I make a compressed RAM drive and externally prepare a (pre-)compressed file to copy onto it?

I don't know what these things are called exactly in the Linux world. But there is the concept of a drive in RAM, to write files onto and read them like it was any disk drive. There is also the c...

1 answer  ·  posted 2y ago by CanisSomnolentus‭  ·  edited 3mo ago by matthewsnyder‭

71%
+3 −0
Close all desktop notifications

I'd like to hide/dismiss/remove all the notifications that applications like Signal have created. I know I can create notifications with, for example, notify-send -t 10000 "🤖 Here goes my message"...

1 answer  ·  posted 2y ago by Matthias Braun‭  ·  last activity 2y ago by Matthias Braun‭

71%
+3 −0
VPN tunnel for outgoing connections but still allowing incoming bidirectional connections, using Wireguard or OpenVPN on Linux

For a particular use case, I need to be able to set up a Linux host (specifically Debian) to use a VPN tunnel for routing outgoing connections, but still allow incoming connections outside of that ...

0 answers  ·  posted 2y ago by Canina‭  ·  last activity 8mo ago by Mithical‭

71%
+3 −0
Disable transient symbols for compose and dead keys in GTK programs

An article in the GTK blog explains the situation very well, but here is my go at it. In my keyboard layout, accents are handled as dead keys, so to insert "ë", first I type ¨ and then e. Nothing ...

1 answer  ·  posted 2y ago by Quasímodo‭  ·  last activity 1y ago by Quasímodo‭