Name

q

Synopsis

[address]q

Description

Quit when address is encountered. The addressed line first is written to output (if default output is not suppressed), along with any text appended to it by previous a or r commands.

Examples

Delete everything after the addressed line:

                     /Garbled text follows:/q

Print only the first 50 lines of a file:

                     50q

Get Linux in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.