AWK
AWK is a classic Unix programming language and command-line tool, created in 1977 by Alfred Aho, Peter Weinberger, and Brian Kernighan, designed for scanning and processing structured text data, especially columnar or line-delimited files.
32 resources across 2 libraries
Glossary Terms(3)
AWK
AWK is a classic Unix programming language and command-line tool, created in 1977 by Alfred Aho, Peter Weinberger, and Brian Kernighan, designed for scanning a…
Sed
Sed (stream editor) is a classic Unix command-line utility for parsing and transforming text non-interactively, applying editing commands like substitution, de…
Bash Scripting
Bash scripting is the practice of writing programs in Bash (Bourne Again SHell), the default command-line shell on most Linux systems and macOS's historical de…
Study Notes(29)
sed vs awk vs grep
A comparison of the three classic Unix text tools — when to reach for grep to search, sed to edit streams, and awk for field-oriented and programmable processi…
Arrays in AWK
Understand AWK's associative arrays — string-keyed, dynamically growing collections used for counting, grouping, and lookups — plus multi-dimensional emulation…
AWK and CSV Processing
Understand why splitting CSV on commas is unsafe, and learn how gawk's FPAT variable and built-in --csv mode correctly parse quoted fields, embedded commas, an…
AWK Best Practices
Guidelines for writing AWK programs that are correct, readable, and maintainable, covering quoting, field handling, variable init, and when to move to a script…
AWK in Shell Pipelines
How to slot AWK into Unix pipelines as a field-aware filter and transformer, passing data between grep, sort, cut, and other tools via stdin and stdout.
AWK Interview Questions
Common AWK interview questions and the concepts behind them, from records and fields to associative arrays, special variables, and one-liner techniques.
AWK Pattern-Action Syntax
Every AWK program is a sequence of pattern { action } rules. Understanding how patterns select lines and actions transform them is the core mental model of the…
AWK Quick Reference
A compact reference to AWK's structure, special variables, operators, functions, and the most useful one-liners for everyday text processing.
AWK Scripting for Report Generation
Using AWK's BEGIN/END blocks, printf formatting, and associative arrays to turn raw tabular data into clean, aligned, human-readable reports.
AWK vs Python for Text Processing
A practical comparison of AWK and Python for text and log processing, showing where each tool shines and how to decide between a one-liner and a script.
AWK vs sed vs grep
How the three classic Unix text tools differ in purpose and model, and when to reach for grep for searching, sed for stream editing, or AWK for field-aware pro…
Building a Log Summarizer in AWK
A hands-on walkthrough of building a web server log summarizer in AWK using associative arrays, the END block, and formatted output.
Built-in Variables in AWK
AWK ships with a set of predefined variables such as NR, NF, FS, and OFS that expose the current record, field counts, and formatting controls without any setu…
Conditionals in AWK
Learn how AWK makes decisions using patterns, if/else statements, the ternary operator, and comparison and logical operators to selectively process input recor…
Fields and Records in AWK
AWK splits input into records (lines) and fields (columns). Mastering $1..$NF, the NR/NF variables, and the FS/RS/OFS/ORS separators unlocks nearly all column-…
Log File Analysis with AWK
Practical techniques for parsing, filtering, and aggregating server and application logs with AWK, including field extraction, time-range filtering, and buildi…
Loops in AWK
Master AWK's iteration constructs — while, do-while, for, and the array-oriented for-in loop — along with break, continue, and next for controlling flow throug…
Math Functions in AWK
Explore AWK's built-in numeric functions — sqrt, exp, log, sin, cos, atan2, int, rand, and srand — and the idioms for rounding, other-base logarithms, degree-b…
Multi-File Processing in AWK
Process many input files at once using AWK's NR, FNR, and FILENAME variables, detect file boundaries, and correlate data across files with the classic NR==FNR…
Performance Tips for AWK
Practical techniques to make AWK programs faster: cutting work per record, choosing the right implementation, minimizing regex cost, and avoiding wasteful shel…
Running AWK Scripts
There are several ways to run AWK: inline one-liners, program files with -f, and self-executing scripts with a shebang. Knowing each lets you scale from a quic…
String Functions in AWK
Explore AWK's built-in string functions — length, substr, index, split, sub, gsub, match, sprintf, and case conversion — for extracting, searching, and transfo…
User-Defined Functions in AWK
Learn to define reusable functions in AWK, understand its unusual parameter-passing rules — scalars by value, arrays by reference — and use the extra-parameter…
User-Defined Variables in AWK
Beyond built-ins, AWK lets you create your own scalar and associative-array variables with dynamic typing and automatic initialization, powering counters, accu…
Showing 24 of 29.