Find knowledge base article(s) by searching for keywords in the title e.g. type linux in the search box below
Find knowledge base article(s) by browsing the subject categories of articles
Technology quick references, cheatsheets, user manuals etc.
Shop Online through ShopifyLite
Tutorials on various IT applications.
Search Title    (UL:0 |SS:f)

Software >> OS >> Unix >> Commands >> grep >> How to search for backslash character

backslash need special handling, need to escape \ with another \ for the shell, need to escape \ with another \ for the grep command

e.g. to search for \..\ in myfile.txt

 

The test file :-

case 1: grep without enclosing the pattern within quotes :-

 

case 2: grep using quotes to enclose the escaped backslash (backslash+backslash)

 

 

 

 

 

 

 

[ © 2008-2021 myfaqbase.com - A property of WPDC Consulting ]