Bash Scripting Bash Compare Strings: How to Check if Two Strings Are Equal Whether you’re validating user input or processing text data, knowing how to compare strings is an important skill. In this blog post, we’ll look at four different methods you can use to check if two strings are equal. We’ll use examples to explain each method, providing you
Bash Scripting How to Make a Bash Script File Executable in Linux A Bash script is essentially a text file containing a series of commands. To make a Bash script file executable means giving it permission to be run as a program. In this blog post, we'll start by taking a deep dive into the concept of file permissions in
Linux How to Search Packages With Apt Search Command When you want to install a package on Debian-based Linux distributions using apt, you need to know the exact name of the package. But what if you don’t remember the name? Maybe you remember a portion of a multi-word package name or a few distinct characters. How do you
Linux How to Count the Number of Files in a Directory in Linux Working with Linux often involves dealing with files. One common but deceptively complex task is counting the number of files in a directory. In this blog post, we will explore three different methods for counting the number of files in a directory, each with its own benefits and nuances. Let’
Bash Scripting How to Check if a File Exists in Bash Let's say you're creating a Bash script to save some data in a file. It's important to ensure that the file exists before you try to write to it. If not, your script may not work as expected. This is just one example. In
Linux How to Find Out When a File Was Created in Linux Keeping track of files in Linux is an important part of system administration. Whether you're investigating a security issue or debugging a program, the details of when a file was created can provide essential insights. In this blog post, we’ll discuss how to create a file in
Bash Scripting How to Read a File Line by Line in Bash When dealing with scripting and automation, file manipulation is an essential skill. Whether you’re analyzing log files, processing data sets, or parsing configuration files, the ability to read and interpret file content is critical. In this blog post, we’ll learn how to read a file line by line
shell scripting How to Run Shell Script (.sh) Files in Linux Shell scripts play an important role in the world of Linux. They help automate repetitive tasks and streamline complex procedures. This doesn’t just save users’ time—it significantly reduces the chance of human errors, resulting in more reliable outcomes and improved system stability. In this blog post, we’ll
Bash Scripting How to Write Bash Scripts to Loop Through Array Values Looping through array values is a common task in Bash scripting. For instance, you might want to loop through an array of filenames and execute specific commands on each one. In this blog post, you’ll learn how to write bash scripts that utilize for loops to iterate through array
Docker How to Build a Docker Image With Dockerfile From Scratch Containers have become the preferred method for packaging and deploying applications in modern software development. Among container platforms, Docker has emerged as the most popular choice for building and managing these containers. Before we can run an application as a container using Docker, we must first build a Docker image.
Docker How to Pass Environment Variables to Docker Containers? Containerized applications can run seamlessly across a variety of environments, including development, testing, and production. As these applications move from one environment to another, they often require some configurations to be adjusted to meet each environment's unique needs. For example, in a development environment, enabling verbose debugging can
Kubernetes How to Restart a Pod in Kubernetes Restarting a Pod is a common operation in Kubernetes. There are several reasons why you might want to restart a Pod. For example, you might want to update the container image to a newer version or modify the environment variables to adjust how your application works. In this blog post,
Docker compose Docker-Compose Logs: How to View Log Output? As you deploy containerized applications using Docker, you may occasionally encounter issues that prevent your applications from running as expected. This is where effective troubleshooting becomes essential, and logs serve as your best tool for this purpose. Logs are detailed records of the events that occur within an application. They
Kubernetes Kubectl Rollout Restart: What Is It and How to Use It? In Kubernetes, kubectl rollout restart is a command used to start a new rollout process for three specific Kubernetes objects: Deployment, DaemonSet, and StatefulSet. A rollout process essentially means a gradual, step-by-step recreation of Pods — The old Pods are not removed entirely until the new Pods are running successfully. This
Kubernetes How to Debug CrashLoopBackOff in a Container or Pod When trying to get your containerized application up and running in a Kubernetes cluster, you may run into errors that prevent the application from running. One such error is CrashLoopBackOff. In this blog post, we’ll learn how to debug the CrashLoopBackOff status of a Pod. Our approach? We’ll
Kubernetes Logs kubectl logs: How to Get Pod Logs in Kubernetes (With Examples) Kubernetes is a container orchestration tool used to deploy and manage containerized applications. Like any software, these applications can sometimes fail or not perform as expected due to various reasons. When such failures occur, it’s important to identify and rectify the issue quickly. One key aspect of troubleshooting involves
Docker How to Use Docker CP Command With Examples In Docker, the docker cp command is a powerful tool that provides a way to copy data in and out of a container. This makes it useful for performing tasks such as debugging and data backup. In this blog post, we'll explore how to use the docker cp
Docker Image Tag Why and How to Tag a Docker Image? Learning to properly tag Docker images in a production environment is crucial. Meaningful and consistent image tags not only help users easily identify and select the appropriate image versions for their needs but also enhance clarity and streamline workflows within the team. In this blog post, we’ll learn why
Docker Image What Are Docker Image Layers and How Do They Work? Docker is a widely used containerization platform that enables developers to run and manage applications inside containers. One of the key components of Docker is the Docker image, which acts as a blueprint for creating containers. Essentially, a Docker image is a static file that contains everything needed to run
Docker Docker Entrypoint vs. CMD: What Is the Difference and How to Choose? Docker is a platform that lets us run and manage applications inside containers. Before we can run an application inside a container, we must create a Docker image of the application using Dockerfiles. A Dockerfile is a text file containing instructions that Docker executes to create the image. Each instruction
Kubernetes kubectl cp: How to Copy File From Pod to Local (With Examples) The kubectl cp command is a powerful tool in Kubernetes that you can use to copy files between the local system and a Pod. There are various use cases of this command, including: * Debugging: You can use kubectl cp to copy log files from a Pod. In case the Pod
Docker How to Remove Unused and Dangling Docker Images A Docker image is a static file that contains everything needed to run an application, including the application code, libraries, dependencies, and the runtime environment. In this blog post, we’ll learn how to remove unused and dangling Docker images. But first, let’s understand what they are. What Is
Docker How to Create Docker Image From a Container Docker is a platform that helps run applications inside containers. One of its powerful features is that you can create custom Docker images from containers. Now, you might be wondering, why bother creating an image from a container when you can just use Dockerfiles? One important reason is when you
programming Differences Between Put and Patch in Rest API & When to Use Them In this blog post, we’ll learn about the differences between PUT & PATCH and when to use each method. But before we do so, let’s take a step back and understand some important concepts such as HTTP, HTTP methods, and RESTful APIs. What is HTTP? HTTP stands for