At NameHero, we’ve looked intensively at git, and what an amazing tool it is for all kinds of projects – not necessarily, but primarily for coding. Last week, we saw how to clean up git commit history using rebase, and while we’re on the subject of commits, this is a good time to look at […]
How to Use Git Rebase Interactive to Manage Commits
The first time you truly grasp the potential of git, it seems like magic. It seems that this is a structure for projects that goes beyond just coding, but one that can be applied to any evolving set of text-based files, like documents, meeting notes, and more. Those just starting with git tend to be […]
How to Use set -e -o pipefail in Bash, and Why
There are a ton of best practices in Linux scripting that a lot of people ignore. For example, while a lot of people use git, it’s often used unoptimally by those treating it as just a fancy way of saving their work, rather than using it for atomic changes and branches for features. Similarly, many […]
Bash Array Tutorial: What you Need to Know
Bash scripts allow you to use variables, and that includes arrays. The idea behind bash arrays is the same as that in other languages. A way to store many pieces of data sequentially, using the same identifier and an index. This allows you to iterate through the array and pick out each datum one by […]
How to Use Bash Getopts to Pass Arguments to Scripts
Scripting is an integral part of Linux. As an admin, you’ll soon find yourself using scripts to automate tasks for your specific needs. In an earlier tutorial, we saw how to execute a bash script. But scripts can be even more powerful. Instead of simply being standalone logic that performs set tasks, you can expand […]
How to Use the Tee Command in Linux
The tee command in Linux has a long pedigree, being developed way back in 1973. The fact that it’s been around for so long is a testament to its usefulness. But what’s even more surprising is how little it has changed since then. Linux’s philosophy of “do one thing and do it well”, has served […]
Nmap Scan Types: How to Scan a Server’s Network
In server security, you often need to perform a regular audit of your server, or one belonging to someone else to see what devices are connected to it. In this context, “devices” doesn’t just mean peripherals like keyboards, mice etc, which in any case are irrelevant for most servers, but also mounted devices, open ports, […]
How to Use the lsof Command in Linux
The “lsof” command in Linux stands for “List Open Files”. At any given time in Linux, thousands or even tens of thousands of files are open. Unlike in a system like Windows, Linux famously treats everything as a file, so this command allows you to examine every aspect of a system, regardless of whether it’s […]
Curl vs Wget: Choosing the Right Tool for the Job
If you’ve worked with Linux systems for even a short while, you’ve surely heard of the two tools we use for interacting with remote data – curl and wget. While for simple tasks, we can use them interchangeably, they occupy quite distinct spots in the workflow. While curl is used to transfer data to and […]
Jq Command: All you Need to Know
The “jq” command is a built-in tool in Linux that allows us to process JSON files with the same precision and flexibility that a tool like “awk” or “sed” does with text. We’ve seen in earlier tutorials how powerful “awk” can be, and “jq” brings a similar functionality to JSON. JSON is becoming more and […]
