Created
December 4, 2021 06:36
-
-
Save alsunseri/55e9c3d4d98b90262888fa55bf447ac1 to your computer and use it in GitHub Desktop.
grep for tabs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Several methods depending on the implementation of grep or whether the grep needs to be scripted etc. | |
1: If grep comes compiled with perl regex support use 'grep -P ' | |
grep -P "\t" filelist | |
embedded in a pattern: | |
grep -P "^1.1G\t" /tmp/du-h-output.txt | |
2 this is neat - grep -G $'\t' | |
it works in larger patterns as well: | |
grep -G "^1.1G"$'\t' /tmp/du-h-output.txt | |
3 If you are on the command line and want to risk control-v: | |
in double quotes enter control-v once, let go and then hit the Tab key | |
i.e. | |
grep "<control-v><TAB>" filename | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment