In server environments, we often need to replicate folders across locations. For example, one super common use case is backup, where you periodically backup many log files. Another example is where you need to move the source code of an entire project from one server to another. In such situations, you need to mimic the […]
Category: Linux Command Line
How Curl Follows Redirects on Linux
Curl is one of the most ubiquitous tools on Linux. It comes pre-installed with every flavor, and we often use it in demos or for downloading packages from the Internet. By design, though, the tool doesn’t automatically follow redirects. There are reasons for this behavior, having to do with security. Phishing attacks these days rely […]
How to Use Ufw to Open Port 80 in Linux
In the backend, Linux systems use a tool called iptables to manage firewall rules. This tool is comprehensive and powerful, but unfortunately, confusing as hell. If we wanted to perform the same operation in iptables that we want to perform in ufw, it’s a lot more complicated, even though ufw is just a wrapper around […]
How to Prune Unused Images in Docker
At NameHero, we’re big fans of docker, and have multiple docker tutorials to help you get started. However, there can also be too much of a good thing, as it’s very easy to download a docker image and then forget about it after testing it for a while. Because docker images can replicate entire systems […]
Using Systemctl to Enable Services on Boot on Linux
A service on Linux is a process that runs in the background that you can start, stop, enable, and disable. For modern operating systems, we interact with them using the “systemctl” tool, which interfaces with the systemd subsystem, which in turn manages the “init” system and service manager. As Linux admins, we don’t need to […]
How to Use zsh Syntax Highlighting
In an earlier post, we discussed the basics of zsh, what it is, and how to get started. Today we’ll look at syntax highlighting in zsh, its meaning, and how to implement it. I’ll also explain why it doesn’t work well with bash, even though we can get it to work in a “hacky” way. […]
How to Use the xargs Command in Linux
In Linux, we often need to feed one command’s output into another. The most well-known example is grep, which uses the pipe (|) operator to receive input and then search that input for a specific pattern. I’ve written earlier about using the pipe command with Linux, and we’re all familiar with how it works. Unfortunately, […]
Using the “whois” Command – All you Need to Know
The “whois” command is very well-known in programming circles. The website whois.com is pretty well-known, even though it’s not accredited with ICANN. Using whois, you can find out everything you need to know about a domain – who owns it, when it expires, its status, nameservers, and even the contact information of the owners. In […]
Resolving the “Fatal: Refusing to Merge Unrelated Histories” Error
In git, the “fatal: refusing to merge unrelated histories” error occurs when you merge two branches with no common ancestor and git doesn’t know where to begin the merge. This error doesn’t occur in the normal git workflow, but it can happen when you try to combine two unrelated git projects into a single one, […]
How to Use Dig to Specify a DNS Server
Dig is a Linux tool standing for “Domain Information Groper” (yeah, it’s weird, but it is what it is). It’s used to get DNS information for a particular domain. Other tools do this, most notably “ping”, but dig allows users to go a step further and query specific DNS servers. This is useful for debugging, […]
