sed — the Unix stream editor, present since Version 7 in 1979 — processes text one line at a time, applying editing commands as each line passes through, never holding the full file in memory. This makes it extraordinarily fast on large files and completely bewildering to anyone who approaches it expecting normal text-editor behaviour. Its substitution syntax (s/find/replace/g) has been borrowed by vi, Perl, Ruby, and virtually every scripting language since, making it arguably the most widely replicated command syntax in computing. sed‘s full command set — branching, labelling, holding lines in a secondary buffer — is technically Turing complete, meaning you can write arbitrary programs in it. People have. This is generally regarded as evidence that something has gone wrong.
Home sed: The Stream Editor That Operates Entirely Without Seeing the Whole Stream






















