General Q&A about Linux and Unix-like operating systems
Filters (None)
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 ...
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...
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...
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 ...
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...
How do you find out the number of files in a directory from the command line?
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: ...
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...
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 |...
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...
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 ...
I got this message: Bad owner or permissions on /Users/rbiaa065/.ssh/config What should the permissions be to make ssh happy?
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...
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.
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).
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...
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...
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...
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 ...
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 '*...
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...
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 ...
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...
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...
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 $...
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...
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...
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...
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...
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...
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...
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...
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?
I've met with the phrase RTFM often. I recognize it's 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't ev...
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,...
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 (...
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...
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...
I plan to set up a Raspberry Pi to host some dockerized apps, for it to be accessible to the Internet through a remote proxy, and since I'm no sysadmin, I'm trying to come up with a suitable policy...
Why is libvkd3d1 not upgrading on my system? (lubuntu 20.04 LTS) When I run sudo apt update, apt flags libvkd3d1 and libvkd3d1:i386 as upgradable, but sudo apt upgrade does nothing and reports tha...
I had a nightly cronjob start throwing errors about "inappropriate permissions..." rsync: [generator] failed to set permissions on "/data2/home/redacted/alsoredacted/opt/dell/srvadmin/var/log/open...
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"...
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 ...
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...
Question How do you specify underscores as Vim word boundaries when using vim mode in either bash or zsh? MWE w on this_word should place the cursor on the underscore. A second w should place th...
When exploring the commands from this answer to my previous question, I found that the ist of packages includes a lot that were automatically installed due to dependencies. Obviously I'm interested...
POSIX defines Text file as A file that contains characters organized into zero or more lines. The lines do not contain NUL characters and none can exceed {LINE_MAX} bytes in length, inclu...
In Debian-based distributions, one can update the system with apt upgrade and cleanup unused dependencies with apt autoremove. Period. On Gentoo that is apparently not as straightforward. From G...
I have a RaspberyPi module, with USB connected to another module computer (as USB host) running Linux. The RasPi is configured as USB ethernet gadget. Once I boot the RasPi, and enter dmesg on th...
How do I get the URL of the remote repository that pacman uses to download packages? I know that I can tell pacman which server to use by editing /etc/pacman.d/mirrorlist. But in my case, all of t...