Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

grep a tab in UNIX

Tags:

grep

unix

How do I grep tab (\t) in files on the Unix platform?

like image 444
Sachin Chourasiya Avatar asked Dec 01 '09 11:12

Sachin Chourasiya


People also ask

How do you write a tab in Unix?

tab-insert (M-TAB) Insert a tab character. This is because carriage return is ASCII 13, and M is the 13th letter of the alphabet, so when you type ^M , you get the 13th ASCII character.

How do I see tabs in Linux?

Navigating Tabs in Linux Screen Creating new terminals/tabs in Linux screen can be done with Ctrl-a + c . To navigate to the previous window use Ctrl-a + p . To navigate to the next window use Ctrl-a + n . A list of other useful screen key bindings can be found at screen key bindings.

How do I print a tab in Linux?

Answer: In Bash script, if you want to print out unprintable characters such as tab, you need to use -e flag together with the echo command.

What is tab command in Linux?

The tab command reads the file specified by the File parameter or standard input, and replaces spaces in the input with tab characters wherever the tab command can eliminate one or more spaces. If you specify a file with the File parameter, the tab command writes the resulting file back to the original file.


Video Answer


1 Answers

If using GNU grep, you can use the Perl-style regexp:

grep -P '\t' * 
like image 154
unwind Avatar answered Oct 13 '22 11:10

unwind