explaingit

learnbyexample/command-line-text-processing

10,179ShellAudience · developerComplexity · 1/5LicenseSetup · easy

TLDR

A learning resource covering Linux command-line tools for searching, editing, and reshaping text files, including grep, sed, awk, sort, and more, organized into chapters with exercises, now archived with standalone free ebooks available.

Mindmap

mindmap
  root((CLI Text Tools))
    Search tools
      grep patterns
      find files
    Edit tools
      sed find-replace
      tr character swap
    Transform tools
      awk extraction
      cut columns
      paste join
    Sort and dedupe
      sort ordering
      uniq deduplicate
    Learning
      Practice exercises
      Free ebooks
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Practice using grep, sed, and awk to search and transform text files directly in a Linux terminal.

USE CASE 2

Learn to sort, deduplicate, and compare files from the command line without writing any programming code.

USE CASE 3

Work through exercises for grep and other tools to build confidence before using them in scripts or pipelines.

Tech stack

ShellBashawksedgrep

Getting it running

Difficulty · easy Time to first run · 5min
Free to share and adapt for non-commercial purposes with credit to the source, commercial use is not permitted.

In plain English

This repository is a learning resource for people who want to get better at manipulating text files from the command line on Linux. It covers a range of tools that come built into most Linux systems and are used for searching, editing, sorting, and reshaping text without opening a graphical editor. The content is organized into chapters, each covering a specific tool or group of tools. Topics include grep (for searching text), sed (for search and replace), awk (for more complex text extraction and transformation), sort and uniq (for ordering and deduplicating lines), and several smaller utilities like cut, tr, and paste. There are also chapters on comparing files, checking file attributes, and finding files on the system. The author has since converted all these chapters into standalone free ebooks, hosted online with better formatting, exercises, and solutions. The repository itself is archived, meaning no new updates will be made to it, but all the original chapter files remain available to read. Anyone looking for the most current version of the material is pointed toward those ebooks. The exercises directory contains practice questions for grep that you can work through directly in a terminal. A separate linked repository offers interactive exercises for other tools as well. The license is Creative Commons NonCommercial ShareAlike, which means you can share and adapt the material freely for non-commercial purposes as long as you credit the source. This is a reference and practice resource aimed at Linux beginners and intermediate users who want to get comfortable handling text data from the command line, without needing any programming background beyond knowing how to open a terminal.

Copy-paste prompts

Prompt 1
I have a server log file with thousands of lines. Show me how to use grep to find all lines containing 'ERROR' and count how many there are.
Prompt 2
Using awk, write a one-liner that prints the second column of a tab-separated file and sums the values in that column.
Prompt 3
I need to replace all occurrences of an old domain name with a new one across a text file using sed. Show me the command and explain each part.
Prompt 4
Show me how to use sort and uniq together to find which IP addresses appear most often in an access log file.
Open on GitHub → Explain another repo

← learnbyexample on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.