Search
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'm using the Gnome System Monitor in Linux Mint. Whenever I attempt to "End" or "Kill" a process, I am given this warning via a modal dialog (emphasis mine): Killing a process may destroy data,...
My assumption has been that shell-scripting is for scripts only, not interactive usage. Whereas shell is everything else, like interactive usage. I wish we could edit these descriptions to clarify...
This other answer tries to truncate each line to make it fit the width of the terminal. It's hard to do this reliably because e.g. a tab character counts as one, but it looks like several spaces; o...
(Assuming your file names are portable, according to POSIX (https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282). If not, please read this for writing a more robust...
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...
I'm going to assume that you're using OpenSSH, since that is probably the most common SSH implementation on present-day *nix systems. The easiest is probably to use ssh-keygen -R to delete all kno...
for file in in chapter-*.xhtml do sed -ir "12s/\b([A-Z])([A-Z]+)/\1\L\2/g;" "$file" done This -ir tells GNU-sed so alter the file in place (-i) and use regexp-extended (-r). For line 12...
Do not embed {} in the shell code. If your {} gets expanded (by xargs) to ./rogue name $(reboot).txt then bash -c 'my-func "{}"' _ will become bash -c 'my-func "./rogue name $(reboot).txt"' _ a...
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'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...
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...
I'd like to debug NetworkManager by stepping through it using GDB. I assume I'll have to compile NetworkManager from source to get debug symbols since file /usr/bin/NetworkManager indicates that th...
If I just used find to generate a list of files, then find's -exec argument is usually the way to run some other program on each file found. If you pipe the command to xargs, note that -P n wi...
When running sed through fish, I often encounter a problem with regexes. Many commonly used regex control characters like []{}().+ need to be escaped, even if I type the regex in a single quoted st...
The usual way is to specify an installation location with ./configure --prefix="$HOME/python" ... and then make install after make. If you don't specify a --prefix argument to configure, it ty...
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?
The best method is to navigate to the folder containing your Flac audio files and use the following 'for' loop: for j in *.flac do ffmpeg -i "$j" -c:a libmp3lame -b:a 128k mp3/"${j%.flac}.mp3" ...
I'm not sure which exact fragment, functionality or aspect is problematic to you. Here I will make points (paragraphs) about what I used to struggle to understand, or about what I suspect may be no...
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 (...
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...
This isn't an answer so much as some information related to your question. We have an open GitHub issue to add searching on reactions. We can already search by post type, category, user, score, a...
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 ...