Bash: Grep lines that start with a tab character


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.

Leave a Reply