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
The local port range on my Arch Linux installation is 32768-60999 according to cat /proc/sys/net/ipv4/ip_local_port_range Wikipedia states that this range is "used by many Linux kernels" and th...
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...
****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...
I want to switch hard drives. How do I migrate my root FS from the drive it's on, to the new one, so that everything is exactly as it is?
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...
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?
Some pacman functions require sudo. When I forget the sudo, you get: error: you cannot perform this operation unless you are root. I then have to press the keys: up, home, s, u, d, o, space, en...
Why does XDG_DATA_HOME default to ~/.local/share? Why not something less cryptic, like ~/.data? Why did they decide use that path?
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...
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 search for files on my system? Ideally, I would like to search by various criteria, like date, name, extension, etc.
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 ...
When I create the initramfs, I sometimes see messages like: ==> WARNING: Possibly missing firmware for module: 'xhci_pci' I get many for different modules. What do they mean? Should I in...
How to show a list of files belonging to a package with pacman?
If I have an email in EML format, how can I determine its spam status from the terminal? My mail provider appears to insert a X-Acme-Spam-Status header. It looks like X-Acme-Spam-Status: v=1; e=b...
At the moment GPG only offers the following options when generating a new subkey the with the addkey command: gpg> addkey Please select what kind of key you want: (3) DSA (sign only) (...
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.
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 ...
How to convert a json file to yaml? Technically json is already valid yaml, but I'm talking about the characteristic easy-to-read yaml formatting with indentation and minimal quotes.
After installing the InconsolataGo font from the Arch package extra/ttf-inconsolata-go-nerd, I see there is an Inconsolata Nerd Font, Regular and an Inconsolata Nerd Font Mono, Regular. Both are mo...
When I run Kmail on i3, and then close it, it appears to continue running some stuff in the background. For example, I periodically get notifications about new mail from dunst, even though I have c...
I want to connect to my university network via OpenVPN under Fedora GNOME. I imported the openvpn configuration provided by the university in the Network Manager GUI and specified the user certifi...
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...
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...
When I try to start MariaDB server (same problem with MySQL) on a fresh Debian 11 install in a Windows Subsystem Linux (WSL) I got the following error: $ sudo systemctl start mariadb System has n...
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...
~/.config/systemd/user intended purely for units created and managed by the user manually, or are there any automated processes that expect to control it? For example, do packages or programs ever...
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...
Suppose I have a directory structure like ├── src │ ├── folder_a │ │ ├── file_w │ │ └── file_x │ ├── folder_b │ │ ├── file_y │ │ └── file_z and I back it up using rsyn...
Guix is a rolling release distro. Another well known rolling release distro is Arch Linux. In Arch, you are expected to frequently do system updates. Partial updates are not supported. In my exper...
Will the overall unit status be failed if either ExecStop or ExecStopPost fail? I would expect it to be so, but the documentation isn't very explicit about it.
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...
I like how Guix sounds based on what I've read, and I want to try it. However, my partitioning scheme is a bit complicated. With Guix it appears like my biggest concern is hardware (I will regretta...
I uninstalled PulseAudio and installed PipeWire. It seems like now, every application gets an independent audio configuration. When I go into pavucontrol I see "Spotify" where I configure the volu...
Suppose I have a PDF which is 2x3 in. I want to create a PDF with a single page, which has multiple copies of this. For example, if the small pieces are in landscape, and the large page is in portr...
I have a script that does git fetch for a repository. When I run this in my shell it works fine. I want to run it in a systemd user unit. However, I am using an SSH url, and the systemd unit fails...
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...
How can I remap buttons on my mouse, especially for more exotic ones like MMO mice?
I want to have a local DNS server on my home LAN, say at 192.168.1.123. All of my machines will use 192.168.1.123 as their only DNS server when connected to my home network. By default, my DNS ser...
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...
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...
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...
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?
How to get the (index) digest of a remote container image with skopeo? So this would be your normal container image in a container registry. E.g. in docker.io
How to apply a logical not to a shell command, e.g. in a Bash script? So if the command exited with 0 (success) I would like it to be changed to a non-zero value, and if it exited with a non-zero ...
How to pretty print XML in a shell? I have command-line tool which outputs XML in a single line, totally unreadable. I would like something to pipe this into, to turn it into human readable XML wi...
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?
How do I configure my system so that all GUI apps use a consistent DPI, without configuring each app individually?