Let’s say you install a tool. Maybe it’s Node, or maybe it’s a CLI for a project you just cloned. The installer runs successfully. Then you open your terminal and type: node And your shell responds: zsh: command not found: node A completely normal reaction to seeing “command not found.” At some point, most of […] The post What the…
#bash
9 posts
30 Mar
20 Apr 2020
Over the past few years I have been participating in Stand-up meetings and it took me some time to find a convenient and effective way for keeping notes about what I was doing every day. I needed to be able to: keep notes on the issues I worked on, the meetings I participated in and stuff that blocked my work…
6 Feb 2020
Yesterday I saw a great command that finds the palindrome dates between now and x days ago. The command was posted on Twitter by @climagic (a great account to follow if you want to find awesome command line stuff). In this post we are going to break it down and explain how it works. What is a palindrome Palindrome is…
16 May 2019
Suppose you have a text file and you need to remove all of its duplicate lines. TL;DR To remove the duplicate lines preserving their order in the file use: awk '!visited[$0]++' your_file > deduplicated_file How it works The script keeps an associative array with indices equal to the unique lines of the file and values equal to their occurrences. For…
10 Apr 2019
I use the terminal a lot and in my day to day work I tend to navigate to the same bunch of directories. There are some awesome tools out there (like autojump or z) but sometimes, especially when the directories are similarly named, there is a need to be explicit to navigate to the proper one. I decided to write…
17 Dec 2018
Customize your terminal prompt with Bash PS1 variable and RANDOM function to show a random emoji on each command. Learn Bash arrays, escape sequences, and functions. Emojis make your terminal more fun and keep your morale up during debugging.
5 May 2018
The AWS CLI s3 cp command supports streaming content to and from S3 using stdin/stdout with the - argument. This enables powerful pipelines without intermediary files.
8 Jul 2017
Some time ago I was faced with a task of testing a bash script. At first I decided to use Python unit-tests, however, I was reluctant to bring external technologies to the project. Therefore I had to go with the testing framework written in the notorious bash. Overview of the existing solutions After googling available solutions, I was presented with…
15 Aug 2016
By using a combination of curl, grep, cut, sort, uniq and other common bash utilities it is possible to extract structured data from Wikipedia and compute insights without writing a full program.