Advanced sed Techniques for Text File Processing

sed Command Reference Displaying Specific Lines To print the 10th line of /etc/passwd: sed -n '10p' /etc/passwd To print lines 8 through 15 of /etc/passwd: sed -n '8,15p' /etc/passwd To print line 8 and the next 5 lines of /etc/passwd: sed -n '8,+5p' /etc/passwd Pattern Matching To print lines starting with 'nginx' in /etc/passwd: sed ...

Posted on Mon, 29 Jun 2026 16:09:36 +0000 by mescal