In this article, we are going to learn how to diff a directory for only files of a specific type in Linux. This is particularly useful when you need to compare configuration files, source code, or documentation across directories while ignoring irrelevant file types. The diff Command Overview The diff command is a powerful built-in Linux tool that compares files and directories line by line. When comparing directories, it identifies differences in file contents, missing files, and additional files. However, by default, it processes all files, which can be overwhelming in directories with mixed file types. Basic ... Read More
Creating a crontab through a script on Linux is a simple and efficient way to automate repetitive tasks and schedule them to run at specific intervals. This article explores how to create and manage crontab entries through scripts, including practical examples and troubleshooting tips. What is a Crontab? A crontab (cron table) is a configuration file that specifies shell commands to run periodically on a given schedule. The cron daemon reads these files and executes commands at the specified times. Each user can have their own crontab file, making it useful for tasks such as running backups, sending ... Read More
When working with data analysis, it is often necessary to align multiple files based on a shared column. This process involves combining data from different sources using a common identifier, typically found in the first column. File alignment is essential for creating comprehensive datasets that can be analyzed effectively. Why Align Multiple Files? In data analysis, we frequently encounter situations where related information is stored across separate files. Aligning these files based on a common column allows us to: Combine data from multiple sources for comprehensive analysis Detect errors and inconsistencies across datasets Create unified reports ... Read More
Bash is a shell language used in Linux systems that allows users to interact with the system through a command-line interface. Bash offers several string manipulation capabilities that can help users manipulate and process text strings effectively. Basic String Operations Bash provides fundamental operations for manipulating strings. To create a string variable in Bash, you simply assign a value to a variable name − mystring="Hello, world!" To display contents of a string variable, you can use the echo command − echo $mystring The output will be − Hello, ... Read More
In the world of computing, the Disk Controller is a fundamental component that manages data transfer between a computer's storage devices and its memory. It acts as a crucial interface between storage hardware and the Operating System (OS), enabling efficient communication and data management operations. What is a Disk Controller A Disk Controller is a hardware component that manages the flow of data between a computer's storage devices (hard disk drives, SSDs) and the system memory. It translates high-level OS commands into low-level disk operations, controlling read/write operations and ensuring reliable data transfer. Disk Controller Architecture ... Read More
Kernel management is a crucial system administration task in CentOS, RHEL, and Fedora. When you install kernel updates, the old versions are kept as a safety measure, but over time these can accumulate and consume valuable disk space, potentially causing boot issues or system slowdowns. Removing old unused kernels frees up disk space, reduces boot menu clutter, and eliminates potential security vulnerabilities in outdated kernel versions. However, it's important to always keep at least one or two recent kernels as backup in case the current kernel encounters issues. Checking the Current Kernel Version Before removing any kernels, ... Read More
MySQL is one of the most popular relational database management systems in use today, and running it on Kubernetes can provide a highly scalable and flexible solution for managing your database workload. In this guide, we will walk you through the process of deploying MySQL on Kubernetes, from setting up a Kubernetes cluster to creating a MySQL deployment, adding persistent storage, and exposing the deployment with a service. We will be using YAML files to define our Kubernetes resources, and we will also provide detailed explanations and examples of each step along the way. Whether you're new to Kubernetes ... Read More
As system administrators or DevOps professionals, we often need to exchange file contents. For example, you might have a backup file /etc/passwd.backup that you want to restore to /etc/passwd, while preserving the current content by moving it to the backup file. This operation is called file swapping − exchanging the actual content of two files, not their locations. When we talk about swapping two files on Linux, we mean exchanging their content while keeping their names and locations unchanged. This tutorial demonstrates practical methods to accomplish this task using command line tools. Example Files Setup Let's create ... Read More
There are times when we need to determine whether a particular file type is present in a directory or not. For instance, we might want to check if a directory contains Python files or C++ source files. Several Linux commands like ls, find, and file can help us accomplish this task efficiently. In this tutorial, we will review multiple approaches to check whether particular file types exist in a directory using wildcard patterns and command-line utilities. Using the ls Command The ls command is one of the most frequently used commands in Linux for listing files and ... Read More
Root-login over SSH is a common method for gaining access to a Linux server, but it poses significant security risks. In this article, we will explore the reasons why disabling root-login over SSH is a critical security practice, and provide step-by-step examples of how to implement this safeguard. What is Root-Login Over SSH? When a Linux server is set up, the root user is created by default. The root user is the most powerful user on the system, with unrestricted privileges to perform any task, including making changes to system configuration, installing software, creating users, and accessing all ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Economics & Finance