Search
For a couple of days now I've been trying to edit this answer to include an example that was requested in the comments. Every time I try to edit it I'm presented with this: The expanded answer ...
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...
For most users, in $HOME/.config/gtk-3.0/bookmarks. Otherwise, if you set the XDG_CONFIG_HOME environment variable (which you can inspect with env), in $XDG_CONFIG_HOME/gtk-3.0/bookmarks. From the...
From man xxd, the section on the -r flag (emphasis added): -r | -revert reverse operation: convert (or patch) hexdump into binary. If not writing to stdout, xxd writes into its output file with...
What you describe is a typical mixed authoritative/recursive resolver setup. Such a DNS server setup will respond from its own data about zones for which it has explicit configuration, and will per...
According to the keyboard layout wiki, keyboard configurations (for both the console and Xorg) can be conveniently set using the localectl command. In order to set a second keyboard layout, we hav...
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...
I would consider your own tools as the central use case. Seriously, do you want to litter every while read (or your language's equivalent) with this pesky corner case handling? while read -r line ...
The simple and obvious solution: sed 's/^ *//;s/ *$//' Many recipes you find online will erroneously add a g flag, but these regular expressions can only match once per line anyway. (In some m...
Linux does have the concept of a RAM DRIVE (multiple concepts actually, including ramfs and tmpfs being common). You should look at https://en.wikipedia.org/wiki/Zram - ZRAM claims to be exactly ...
Note that if you want to debug the currently installed version of NetworkManager, you don't have to compile NetworkManager yourself. Instead, make GDB download symbol files via debuginfod. You can ...
GNU which does the trick: $ which find /usr/bin/find It's very likely already installed.
I'm quite certain that rsync is not able to deduce that /path/to/src/folder_a/file_w on one side of the transfer is identical to /path/to/src/folder_c/file_w on the other side of the transfer. The...
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...
Especially in a pedagogical context, the issue with something like cat /dev/random | head -c 20 versus the more straightforward head -c 20 /dev/random is that it communicates that extra ceremony is...
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?
dmidecode can do this. Here's an example output from my system: # dmidecode --type 2 Getting SMBIOS data from sysfs. SMBIOS 3.1.1 present. Handle 0x0002, DMI type 2, 15 bytes Base Board Info...
There's a sha1sum tool in GNU coreutils. Here's $ sha1sum emptyfile da39a3ee5e6b4b0d3255bfef95601890afd80709 emptyfile Note the spaces and the filename (emptyfile in this case) in the output...
How can I auto-enable FN-toggling for the first N FN keys? F7-F12 on my keyboard are used for audio control, while, many games that I play, use the lower FN keys. Therefore, I'd like to relieve mys...
How can I print the version of a program in the terminal, so that I know which one I have installed?
On Wayland, the wl-clipboard utility wl-copy is the program you want: echo hi | wl-copy
I've recently gained some PAM (Pluggable Authentication Modules) knowledge. I had written a Reddit post plus reply and then thought the stuff I shared would fit well here. Do domain-specific how-t...
Suppose I have some hypothetical CLI program. It is important that only one instance of this program runs at any given time. When multiple instances run concurrently, bad things happen. Normally, ...
This can be done using the flock utility. The most useful mode for preventing multiple invocations of a same process is likely to be -en (exclusive lock, no wait). You need a file or directory (ye...
Sometimes I work with Git repos that have some changes fetched but not yet merged to the local branch. Occasionally I make commits without noticing this, which necessitates rebase/conflict resoluti...