Escape sequences

Within string and regular-expression constants, the following escape sequences may be used.

Sequence

Meaning

Sequence

Meaning

\a

Alert (bell)

\v

Vertical tab

\b

Backspace

\\

Literal backslash

\f

Form feed

\nnn

Octal value nnn

\n

Newline

\xnn

Hexadecimal value nn

\r

Carriage return

\”

Literal double quote (in strings)

\t

Tab

\/

Literal slash (in regular expressions)

Tip

The \x escape sequence is a common extension; it is not part of POSIX awk

Get Linux in a Nutshell, 6th 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.