Linux Articles

Page 67 of 134

How to Evaluate Arithmetic Expressions in Bash?

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 2K+ Views

Bash is a powerful shell scripting language used on Linux and Unix systems. One of the most common tasks in shell scripting is evaluating arithmetic expressions. This article explores various methods to evaluate mathematical calculations in Bash scripts. Methods for Arithmetic Evaluation Bash provides several ways to evaluate arithmetic expressions. While the traditional expr command exists, modern Bash offers more efficient built-in methods. Using expr Command The expr command evaluates expressions passed as arguments: $ expr 2 + 3 5 Using Arithmetic Expansion $((...)) The preferred method uses double parentheses for ...

Read More

Linux comm Command

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 993 Views

The comm command is a powerful Linux utility used to compare two sorted files line by line. It displays the comparison results in three columns: lines unique to the first file, lines unique to the second file, and lines common to both files. This command is essential for file analysis, data comparison, and finding differences between datasets. Syntax comm [OPTION]... FILE1 FILE2 Where FILE1 and FILE2 are the two sorted files to be compared. Common Options -1 − Suppress column 1 (lines unique to FILE1) -2 − Suppress column 2 (lines unique ...

Read More

The Linux join Command

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 2K+ Views

The Linux join command is a powerful text processing utility that merges two sorted files based on a common field. It reads the contents of two files and combines lines that share the same value in a specified field, creating a unified output. This command is particularly useful for database-like operations, combining related data from multiple sources, and creating reports from structured text files. Syntax The basic syntax for the join command is − join [options] file1 file2 Key Options Option Description -t CHAR Specify delimiter ...

Read More

Using sed to Replace a Multi-Line String

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 12K+ Views

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 More

Linux Commands – Remove All Text After X

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 408 Views

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 More

Free Command in Linux

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 696 Views

The free command is one of the most essential Linux system administration tools used to display memory usage information. It provides real-time statistics about physical RAM, swap space, buffers, and cache usage, making it invaluable for system monitoring and troubleshooting memory-related issues. What is the Free Command? The free command displays the total amount of free and used physical memory and swap space in the system, as well as the buffers and cache used by the kernel. It reads information from /proc/meminfo and presents it in a human-readable tabular format. Syntax free [options] ...

Read More

Guide to Linux screen Command

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 793 Views

When working on a Linux terminal, you may sometimes need to keep several processes running at the same time. However, if you close the terminal or accidentally disconnect from a remote session, processes will terminate, and you may lose all your progress. This is where the Linux screen command comes in handy. Screen is a powerful command-line utility that allows you to create and manage multiple terminal sessions within a single shell window or over SSH connections. It is a handy tool for managing long-running processes or multiple commands, even if you are not physically connected to the server. ...

Read More

Using xz Compression in Linux

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 5K+ Views

xz compression is a high-ratio data compression tool widely used in Linux environments to reduce file sizes, improve transfer speeds, and save storage space. Developed by Lasse Collin and based on the LZMA (Lempel-Ziv-Markov chain-Algorithm) compression algorithm, xz offers superior compression ratios compared to traditional tools like gzip and bzip2. How xz Compression Works The xz algorithm breaks input data into small blocks and compresses each block independently using the LZMA algorithm. The compressed blocks are then combined and stored in an output file with the .xz extension. LZMA uses a combination of dictionary-based and statistical compression techniques ...

Read More

Find the Process That is Using a File in Linux

Kunal Verma
Kunal Verma
Updated on 17-Mar-2026 25K+ Views

When working with files in Linux, you may encounter situations where you cannot unmount a filesystem or access a file because it shows as "busy". This occurs when a process is actively using the file, keeping it open for reading or writing. To resolve this, you need to identify which process is using the file. This tutorial covers the essential commands to find processes that are using specific files in Linux systems. Note − Linux commands are case-sensitive. Commands to Find the Process Linux provides several commands to identify processes working with files. These commands gather ...

Read More

Fixing the "Too many open files" Error in Linux

Kunal Verma
Kunal Verma
Updated on 17-Mar-2026 28K+ Views

On Linux servers under heavy load, the "too many open files" error occurs frequently. This error indicates that a process cannot open new files (file descriptors) because it has reached the system-imposed limit. Linux sets a default maximum open file limit for each process and user, and these default settings are often modest for production workloads. The number of concurrent file descriptors that users and processes can open is constrained by system limits. When a user or process attempts to open more file descriptors than allowed, the "Too many open files" error appears. The solution involves increasing the maximum ...

Read More
Showing 661–670 of 1,338 articles
« Prev 1 65 66 67 68 69 134 Next »
Advertisements