Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I want grep to grep one word which is having spaces it [duplicate]

I would like to grep the word “s a i” (which has spaces in it) in a xyz.txt file which is saved in another directory. I tried to find an answer but I didn’t manage to find any. I have to use the grep command only.

like image 334
Sai Srikanth Avatar asked Mar 08 '23 12:03

Sai Srikanth


1 Answers

You can escape the space with a backslash:

grep My\ Documents
like image 63
juanmah Avatar answered Apr 05 '23 22:04

juanmah