UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: fileChapter 9
The ex Editor
Next: Reference: insert
 

global

[address] g[!]/pattern/[commands]

Execute commands on all lines which contain pattern or, if address is specified, on all lines within that range. If commands are not specified, print all such lines. Add a ! to execute commands on all lines not containing pattern. See also v.

Examples

:g/Unix/p
:g/Name:/s/tom/Tom/


Previous: Reference: fileUNIX in a Nutshell: System V EditionNext: Reference: insert
Reference: fileBook IndexReference: insert

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System