Having trouble finding a word in multiple files

Colin Law clanlaw at gmail.com
Sun Jun 14 08:28:55 UTC 2020


On Sun, 14 Jun 2020 at 09:25, Ralf Mardorf via ubuntu-users
<ubuntu-users at lists.ubuntu.com> wrote:
>
> On Sun, 14 Jun 2020 03:53:41 -0400, Pat Brown wrote:
> >I've tried a variety of grep commands but I can't find the specific
> >word I'm searching for that is in a file or files somewhere in my
> >Dropbox folder. The word I'm trying to find is Blowback. Can someone
> >please help me with the correct command?
>
> $ mkdir Desktop/.tmp{1,2}
> $ echo ":)" > Desktop/.tmp1/file.txt
> $ echo "Blowback" > Desktop/.tmp2/file2.txt
> $ grep -r -i blowback Desktop/
> Desktop/.tmp2/file2.txt:Blowback

Or if you just want to know which files it is in then you can add -l
(lower case L) so it just lists the filenames
grep -ril blowback Desktop/

Colin

>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users




More information about the ubuntu-users mailing list