General Q&A about Linux and Unix-like operating systems
Filters (None)
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?
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,...
I somehow managed to unknowingly change the default app for opening directories on my laptop. E.g. when I use the option open containing folder in a program like Evince, my editor (vscode) opens u...
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 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...
I am using Linux Mint 20.3, with Cinnamon as a window manager. I have a folder named .pytest_cache on my Desktop: $ ls -1A | grep '^\.' .pytest_cache I know that if I open a Nemo window, navi...
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 my key added to ssh-agent and they show up in ssh-add -l. When I try to actually SSH to a host that requires the key, I still get prompted for a password. I enter it again and again and it s...
BTRFS is capable of spanning over multiple drives. How to add one more to an existing filesystem?
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 ...
How to open a port when using firewalld as the system firewall?
How to configure ZSH shell to print a timestamp on the right hand side of the prompt line when executing a command? I don't want to display the time prior to executing a command. Here's about how ...
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
I have an image (a photo) and I want to highlight certain parts of this. I want to do this from the CLI. I am planning to store the pixel coordinates of polygon vertices in a file, and when I run ...
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 ...
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...
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?
The systemd manual gives a list of path where systemd looks for unit files. However, I want to isolate my units in a path of my own choosing. Is it possible to configure systemd to add some path t...
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 ...
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 ...
Let's say I have workspaces 1, 2, 3 on screen A and 4, 5 on screen B. Currently workspaces 1 and 4 are active. With my current config, moving a window to another workspace never activates it. How...
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...
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...
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...
MWE To reproduce: Add bindkey -v to your ~/.zshrc. Invoke python interpreter: python. Type something into the prompt without hitting ENTER: this = "this" + "that". Press ESC and try any vim ...
I can start services with systemctl start. I can see logs with systemctl status or journalctl. But by the time I run the second the process has already started. I'd like to start a service and imme...
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 ...
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...
How do I make my computer request a new IP from DHCP? I am using Arch with NetworkManager.
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) (...
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).
MWE startx && xrandr-invert-colors Problem It seems that anything after startx does not get issued in the resulting X session. I'd like to make a bash function that sets up my monito...
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...
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...
Problem I'd like to be able to decrease images, particularly jpg and png's, either to a percentage of the original file, or a specified size in bytes. MWE decrease --size=900KB -o image_small....
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$ ...
Spotify runs on my computer with higher DPI (bigger UI elements) than I'd like. How can I reduce it?
I have some bookmarked folders in GtkFileChooserDialog. I want to add these to my dotfiles. Where are the bookmarks stored?
When hardening my system with Lynis I had information about /etc/issue and /etc/issue.net being found weak. Lynis redirects me to Enterprise, which is a paid product and a bit overkill for my home...
Problem I can rotate output, but it does not fill screen. Instead it rotates in place so that the right side of the screen goes off the monitor. xrandr --output HDMI-2 --auto --mode 1920x1080 --...
A system daemon needs to create several files under /run/program-name/ (and possibly other subdirs of that). They are the PID file, and at least one Unix socket file (but maybe more). The FHS spe...
Trying to understand what exactly <!nocheck> does next to a package in build-depends (for example, Perl). Debian Wiki says: Terms can be negated by using an exclamation mark as a prefix ...
How do I configure my system so that all GUI apps use a consistent DPI, without configuring each app individually?
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 installed the Nvidia container toolkit so I can use GPU acceleration in Docker containers. However, I can't get the containers to work: $ sudo docker run --runtime=nvidia nvidia/cuda:12.2.0-base...
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...
Have I have the DPI on my laptop set in .Xresources with Xft.dpi: 192. I am outputting to the external monitor with: xrandr --output HDMI-2 --auto --rotate left --right-of eDP-1 Want I want ...
After a force shutdown on Ubuntu 22.04, installed on a Lenovo Legion 5, the OS seems to have lost its ability to recognize the built-in touchpad or to connect to the internet. For the backstory......
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...