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 explore three methods of finding out when
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 enhances clarity and streamlines 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 that contains instructions that are executed by Docker to create the
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? Well, one important reason is when
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. HTTP HTTP stands for Hypertext Transfer
Docker How to Get Docker Container IP Address From the Host? In this blog post, we’ll explore various methods for finding the IP address of a Docker container that was started with the default container networking. When we say that a container was started with the default container networking, it means that the container is using the built-in Docker networking
Kubernetes How to Use Kubectl Delete Deployment (With Examples)? Kubernetes is a popular container orchestration tool used to deploy and manage containerized applications at scale. In Kubernetes, a Deployment describes a deployed application. It is a higher-level abstraction that manages an application’s desired state, such as the number of replicas (copies), the container image to use for the
Kubernetes Kubectl Create Namespace: How to Create a Custom Namespace? In this blog post, we'll learn how to create a custom Namespace in Kubernetes using the "kubectl create namespace" command. But before we do so, let's take a step back and understand what a Namespace is and why it's useful. What Is
Kubernetes Kubectl Exec: How to Execute Shell Commands Into a Container (With Examples)? Kubernetes is a powerful container orchestration platform for easily deploying and managing containerized applications. But managing containerized applications is about more than just getting them up and running. Sometimes, you’ll need to interact with the containers to perform important tasks, such as debugging issues or modifying files or directories.