How to grep a tab on Linux?

How to grep a tab on Linux? Including ‘t’ seems not working.

grep can grep tabs. The problem is likely the tab is not passed to grep.

If you are using Bash, you can use ANSI-C quoting to pass the “tab” to grep:

$ grep $'t' file.txt

Or, use Perl-style regex (only for GNU grep) to grep tab:

$ grep -P 't' file.txt

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *