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
Articles on Trending Technologies
Technical articles with clear explanations and examples
Using sed to Replace a Multi-Line String
Sed (Stream Editor) is a powerful command-line tool used for parsing and transforming text in files or streams. While sed operates line-by-line by default, it can be configured to handle multi-line string replacements through special commands and pattern space manipulation. Understanding Sed's Basic Syntax The fundamental structure of sed's substitute command is: s/pattern/replacement/flags Where pattern is a regular expression matching the text to replace, replacement is the new text, and flags modify the command's behavior (such as g for global replacement). Multi-Line String Replacement Technique To replace multi-line strings, sed must load ...
Read MoreDifference Between fork() and vfork()
In this post, we will understand the difference between system calls fork() and vfork() − Both fork() and vfork() are system calls used to create child processes in Unix-like operating systems. However, they differ significantly in how they handle memory management, execution order, and resource sharing between parent and child processes. The fork() System Call The fork() system call creates a new process by making a complete copy of the parent process. Here are its key characteristics: The child and parent process have separate memory spaces. The child and parent process are executed simultaneously. This ...
Read MoreWhat are thread libraries?
A thread is a lightweight subprocess and the basic unit of CPU utilization, consisting of a program counter, a stack, and a set of registers. Threads enable concurrent execution within a single process, allowing multiple sequences of instructions to run simultaneously. Given below is the structure of threads within a process − Thread Structure in Process Process Shared: Code, Data, Files Thread 1 Registers Stack Program Counter ...
Read MoreDifference Between sh and Bash in Linux?
sh and bash are both command-line shells used in Unix-like operating systems, but they serve different purposes and have distinct capabilities. sh (Bourne shell) is the original POSIX-compliant shell, while bash (Bourne Again Shell) is an enhanced, feature-rich successor that extends sh's functionality. What is sh? The sh shell, originally developed by Stephen R. Bourne at Bell Labs, is the standard POSIX shell specification. It provides a minimal, portable command-line interface that works consistently across different Unix systems. sh focuses on compatibility and standardization, making it ideal for writing portable scripts. #!/bin/sh echo "This is a ...
Read MoreHow to Format a Hard Disk on Linux OS
In this article, we will learn how to format and configure a hard disk on Linux OS. When a new drive is installed and visible to the BIOS, it is automatically detected by the operating system. Disk drives are assigned device names beginning with hd or sd followed by a letter indicating the device order (e.g., /dev/sda, /dev/sdb). Detecting the New Hard Drive First, verify that the new drive is detected by listing all storage devices: # ls /dev/sd* /dev/sda /dev/sda1 /dev/sda2 /dev/sdb This output shows that /dev/sda is divided into two partitions (/dev/sda1 ...
Read MoreWhat happens to Open File Handle if file is Moved or Deleted?
When working with files that have open handles, understanding how operating systems behave during file operations like deletion, moving, or replacement is crucial. This behavior depends on how filesystems manage inodes and file references internally. Understanding Files and Inodes In Linux filesystems, files are tracked using inode numbers rather than filenames. A filename is essentially a hard link that points to an inode containing the actual file data and metadata. $ touch inode_example $ stat inode_example File: inode_example Size: 0 ...
Read MoreLinux Commands – Remove All Text After X
Linux commands provide powerful tools for text manipulation, including the ability to remove all text after a specific character or pattern. This is a common task when processing log files, configuration files, or any text data where you need to truncate content at a certain point. The Sed Command Sed (Stream Editor) is one of the most versatile tools for text manipulation in Linux. To remove all text after a specific character X, use the following syntax: sed 's/X.*/X/' filename This command removes everything after the first occurrence of X while preserving X itself. ...
Read MoreBleachBit – A Free Disk Space Cleaner
If you're someone who's always on their computer, you know how quickly files and data can accumulate. Your device's storage capacity may seem endless at first, but it's not long before you're faced with the dreaded "low disk space" notification. This is where disk space cleaners come in. BleachBit is a free and open-source disk space cleaner known for its simplicity and efficiency. What is BleachBit? BleachBit is a disk space cleaner designed to free up space on your computer's hard drive. It's available for Windows, macOS, and Linux operating systems, and it's completely free to download and ...
Read More5 Cool New Projects to Try in Fedora Linux
Fedora Linux is a cutting-edge, community-driven distribution known for its robustness, security, and commitment to open-source innovation. With over 15 years of active development, Fedora consistently pioneers new technologies and provides users with access to the latest software. This article explores exciting projects you can experiment with in Fedora to enhance your Linux experience. Experiment with Containers Containers revolutionize software deployment by packaging applications in portable, isolated environments. Fedora leads container innovation through Fedora CoreOS and native support for tools like Podman and Docker. Build a container image using Podman: podman build -t mycontainer . ...
Read MoreHow to Install Enable OpenSSH on CentOS 7
If you're looking to enable OpenSSH on CentOS 7, you've come to the right place. In this article, we'll take a look at the steps you need to follow to install and enable OpenSSH on your CentOS 7 machine. We'll also explore the benefits of using OpenSSH and how to configure it securely. What is OpenSSH? OpenSSH is a secure shell protocol used to establish a secure connection between two computers over a network. It's an open-source version of the Secure Shell (SSH) protocol, which is widely used to provide secure remote access to servers and other network ...
Read More