Site icon Bytefreaks.net

Bash: Grep lines that start with a tab character

Advertisements

Using a regular expression to match the lines that start with a tab we wrote the following

grep -P '^\t'

The -P parameter (or –perl-regexp) directs grep to interpret the pattern as a Perl regular expression.

The ^ character directs the pattern to match the start of the line.
The \t character directs the pattern to match a tab character.

This post is also available in: Αγγλικα

Exit mobile version