Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Operating System Articles
Page 59 of 171
What is the LD_PRELOAD Trick on Linux?
LD_PRELOAD is a powerful and advanced feature in the Linux dynamic linker that allows users to preload shared object files into the address space of a process before it starts executing. This can be used to override certain functions in the process with custom implementations or to inject additional code into the process at runtime. LD_PRELOAD is often used for debugging and testing purposes, but it can also be used for malicious purposes, such as injecting malware into processes. How LD_PRELOAD Works The LD_PRELOAD environment variable specifies a list of shared object files that the dynamic linker should ...
Read MoreCreating a Temporary File in Linux
In Linux, it is often necessary to create temporary files for various purposes, such as storing intermediate data during processing or storing configuration information for a script. Temporary files are usually created in the /tmp directory, which is a standard location for storing temporary files on most Linux systems. The mktemp Command The most common and secure method to create temporary files in Linux is using the mktemp command. This command creates a unique temporary file with proper permissions and prints the file name to the console. Syntax mktemp [options] [template] The template ...
Read MoreUser-level threads and Kernel-level threads
A thread is a lightweight process that can be managed independently by a scheduler. It improves the application performance using parallelism. A thread shares information like data segment, code segment files etc. with its peer threads while it contains its own registers, stack, counter etc. The two main types of threads are user-level threads and kernel-level threads. A diagram that demonstrates these is as follows − User-level vs Kernel-level Threads User-level Threads Kernel-level Threads Application Process ...
Read MoreConfigure sendmail with Gmail on Ubuntu
Sendmail is a popular mail transfer agent used to send emails from one computer to another. It is often installed by default on Ubuntu, making it a convenient option for sending emails from a server. If you use Gmail, you can configure sendmail to send emails through your Gmail account. In this article, we will show you the process of configuring sendmail with Gmail on Ubuntu. Requirements Before starting, there are a few requirements needed to configure sendmail with Gmail on Ubuntu − A Gmail account An Ubuntu server Sendmail installed on your Ubuntu server ...
Read MoreELK Stack Tutorial: Get Started with Elasticsearch, Logstash, Kibana, & Beats
The ELK Stack is a powerful collection of open-source tools for searching, analyzing, and visualizing log data in real time. Originally consisting of Elasticsearch, Logstash, and Kibana, the stack has evolved to include Beats, forming what's now called the Elastic Stack. This comprehensive solution enables organizations to centralize logging, monitor systems, and gain insights from massive datasets across healthcare, finance, IT, and other industries. Components of ELK Stack ELK Stack Architecture Beats (Data Shippers) Logstash (Processing) ...
Read MoreDelete Multiple Files at Once in Bash
Bash is a Unix shell and command language that is commonly used on Linux systems. It allows users to perform a variety of tasks, including deleting files. In this article, we will look at how to delete multiple files at once in Bash on a Linux system. We will cover the basic syntax for deleting multiple files, as well as some advanced techniques for deleting specific types of files or forcing the deletion of write-protected files. Using rm Command in Linux The rm command is used to delete files in Bash. To delete a single file, you can ...
Read MorePartitioning Disks in Linux
In Linux, a disk partition is a logical division of a hard disk drive (HDD) or solid-state drive (SSD) that allows you to manage data in a more organized manner. Partitions enable you to separate data by function, such as isolating system files from user files, or setting up multiple operating systems on a single physical disk. There are several tools available for creating and managing disk partitions in Linux, including fdisk, parted, and gparted. This article focuses on using the command-line utilities fdisk and parted as they are widely available on most Linux distributions and provide precise control ...
Read MoreMeasure CPU usage for a process on Linux?
On modern multi-core CPUs, monitoring CPU usage of individual cores for specific processes is essential for performance analysis and identifying system bottlenecks. This article demonstrates how to measure CPU core usage for processes on Linux using various command-line tools. Monitoring CPU Usage with top Command The top command is the most common tool for monitoring system resources. By default, it shows aggregate CPU usage, but you can view per-core statistics. To display individual CPU core usage, run top and press 1 to toggle per-core view: $ top Then press 1 to see individual ...
Read MoreCount Duplicate Lines in a Text File on Linux
There are several reasons why you might want to count duplicate lines in a text file on Linux. You may need to identify data inconsistencies, optimize files by removing duplicates, or analyze log files for repeated entries. Linux provides multiple powerful command-line tools to accomplish this task efficiently. Preparation Let's create a sample text file to demonstrate the different methods. Open a terminal and create a test file − $ touch test.txt Add the following content to the file using your preferred text editor − Hello World Hello Linux Linux ...
Read MoreImplement a Counter in Bash Script on Linux
Counters in Bash scripts are variables used to track the number of times specific events or tasks occur. They are essential for loop control, progress tracking, and performing actions after reaching certain thresholds. Understanding how to implement and use counters effectively can significantly improve your Bash scripting capabilities. What is a Counter Variable in Bash Script? A counter is a variable that stores and increments numerical values to count occurrences of events or iterations. It is commonly used in loops to track the number of iterations performed, count files in directories, or monitor task completion progress. Why ...
Read More