General Q&A about Linux and Unix-like operating systems
Filters (None)
How to get the number of lines in a file? I.e. for a file like this: Line one Line 2 Final line I would like to do something like this: $ count-lines /path/to/the/file/above 3
ip a command will conveniently show the addresses assigned to your network interfaces, but oftentimes this is not what the internet sees your machine as. So how to find your public IP address from...
Of course every language has some kind of random library... But can you generate custom random strings with just basic CLI tools? For example, we have /dev/random which provides a stream of random...
How to ignore server certificate when using ldapsearch command-line tool? Of course this isn't something you should be doing regularly, but it would be a handy asset for troubleshooting.
I was looking into unlocking my login after too many incorrect password attempts. I found this post about it. Doing faillock -user $(whoami) --reset did indeed unlock the login. However, what exac...
Wine has options for "Synchronization", like "Esync" or "Fsync". What do these actually do? What is the purpose of such an option? What is the impact to normal usage of a Windows program in Wine?
Sorry it was a typo, _ instead of -, that caused the problem. I want to have a key combination to alter the keymaps. It worked with one for us and one for hu, but now I want to use one key combina...
Sometimes your programs fail because the network port they are trying to use is already in use by some other process. How to find out what this other process is?
I'm trying to containerize an application that currently uses apparmor to confine Python. This allows sandboxing of user-submitted code. How can I get docker and apparmor to play well together? Cu...
For some time pacman used to have a problem where: Occasionally Arch maintainers introduce new GPG keys They start signing packages with the keys Your local pacman doesn't receive these until ...
How can I remap buttons on my mouse, especially for more exotic ones like MMO mice?
When I enter the login password incorrectly 3 times, my computer locks me out from attempting a login for 10 minutes. How can I increase the number of attempts?
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...
On my current setup (running Linux Mint 20.3 Cinnamon), I have an administrative user and several ordinary users. I intend for all of these users to be in the same group, which happens to have the ...
What is the simplest shell idiom for stripping leading and trailing whitespace from a file or program output? Ideally I am looking for the equivalent of trim or strip methods in some languages. Th...
Spotify runs on my computer with higher DPI (bigger UI elements) than I'd like. How can I reduce it?
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...
How can I search for files on my system? Ideally, I would like to search by various criteria, like date, name, extension, etc.
I am testing some DHCP stuff, and I want to manually end a lease so I don't have to wait hours for them to expire. How can I do this with OpenWrt?
I compressed some JPEGs with curtail it messed up the filenames. It was supposed to only add -min at the end but ended up adding a random string after the extension 😠: prs@PC:/DOWNLOADS/Pictures$ ...
How do you securely erase data from a thumb (USB/flash) drive? With traditional (magnetic/spinny) hard drives, it used to be that you could use various tools to simply overwrite with random data, ...
How does the init process play a role in the booting of Linux?
****Since upgrading to Ubuntu 22.04 recently, immediately after a reboot I have WiFi to an internet hotspot as I did prior to upgrading. After suspend then resume, the network is no longer working...
When formatting drives with Gnome Disks, there is an option to "Erase". The help text says this takes longer, but "completely" erases data. What exactly does this option do? Is there a CLI equival...
How can I run a command later? I'm looking for a CLI way to schedule a command to be run later. I know that I could create a systemd timer, install it, activate it... That is too much work. I want...
Problem I want to set a global keyboard rate for both the X session and the console that persists for external keyboards, across plug-ins and removals. To my understanding, Xorg and console sett...
I have some bookmarked folders in GtkFileChooserDialog. I want to add these to my dotfiles. Where are the bookmarks stored?
In i3, is there a way to move an entire workspace to another monitor, including all windows it contains?
Why does XDG_DATA_HOME default to ~/.local/share? Why not something less cryptic, like ~/.data? Why did they decide use that path?
I have multiple screens and I often connect and disconnect monitors while the system is running. i3 assigns a workspace to each monitor, but does so unpredictably. Both workspaces are highlighted a...
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...
My goal is to use a french AZERTY keyboard layout with Arch linux and Gnome desktop environment but use US English as "OS language". Note that I am also open to a "working" solution on any other d...
Whenever I do a big system update, OpenGL stops working until the next reboot. This also prevent OpenGL apps from launching. Example: $ glxgears X Error of failed request: BadValue (integer par...
Is there a way in Ubuntu (22.04) to run a given bash command for a given Key combination in Gnome (42.9)? This Ubuntu is running in Hyper-V on a Win10 host. (I would like to run the setxkbmap us a...
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 ...
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...
You often have to read man pages to use Linux/Unix software. However, many man pages are not easy to read. They are very long, not always conveniently arranged, and man does not appear to have any ...
On Arch Linux, I installed albert (from AUR) and picom as the compositor. I am using i3 as the window manager. When I bring up the albert window, it is surrounded by the ghost of a window in the b...
How to open a port when using firewalld as the system firewall?
From what I can tell, both NixOS and Guix are built around a package manager which, instead of installing package into the "common environment" as is traditional, isolates them to mitigate issues a...
For reasons of my own, I have services on my LAN which use HTTPS and I create my own certificates for these. Over the years, the usage of TLS has evolved considerably. Many features that were once...
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.
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) (...
I recently updated Gnome to 1:44.0 and since the update my dark mode settings seem to be ignored for Gnome applications. When setting the dark style in Settings > Appearance, the desktop backgr...
I have always found PulseAudio to be difficult to use and overcomplicated. Recently I also discovered that it is written by Lennart Poettering, whom I dislike. I am now very motivated to use someth...
SSH agent prints some envar commands for sourcing in a shell. However, these are bash-style, and I use fish. Fish barfs at the bash syntax. How can I fix it?
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...
My keyboard has keys for mute, volume up, volume down. In i3wm, I used to have these bound with: bindsym XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +10 --max-volume 100 ...
Hello everyone, I am encountering an issue when running pytest in my virtual environment. Although I have installed the required modules in my virtual environment using pip, I am still getting a M...