Essential sed Commands for Text Processing
# Print the last line of a file
sed -n '$p' ok.txt
# Output total number of lines
sed -n '$=' ok.txt
# Count blank lines
sed -n '/^$/=' ok.txt
Line Selection and Printing
# Print odd-numbered lines (1st, 3rd, 5th, ...)
seq 10 | sed -n '1~2p'
# Print even-numbered lines (2nd, 4th, 6th, ...)
seq 10 | sed -n '2~2p'
Inserting Content
sed '5 a ...
Posted on Fri, 15 May 2026 06:49:01 +0000 by ghostrider1
Mastering the Stream Editor: A Comprehensive Guide to sed Command Operations
Understanding the Stream Editor (sed)
The Stream Editor (sed) is a powerful utility in Unix/Linux systems for processing text files. It allows you to perform complex text manipulation operations using simple commands. This guide explores the fundamental operations of sed including deletion, insertion, and modification.
Basic Setup
Before workin ...
Posted on Thu, 14 May 2026 13:32:46 +0000 by stefan63
Modifying Network Configuration and Text Processing in Linux
Modifying Network Interface Configuraton
1. Update the Network Configuration File
Edit the configuraton file for the target interface (e.g., ens33).
vim /etc/sysconfig/network-scripts/ifcfg-ens33
Adjust the following parameters:
NAME=enp0 # Corresponds to net.ifnames=0
DEVICE=enp0 # Corresponds to biosdevname=0
2. Rename the Configuratio ...
Posted on Mon, 11 May 2026 09:45:57 +0000 by yogadt