Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

linux + find word in file under directory but quickly

Tags:

linux

bash

I have the following command

find /var  -type f -exec grep "param1" {} \; -print

With this command I can find the param1 string in any file under /var

but the time that it take for this is very long.

I need other possibility to find string in file but much more faster then my example

THX

yael

like image 385
yael Avatar asked Dec 01 '22 10:12

yael


1 Answers

grep -r "string"

The find is not neccesary.

This is a good link, though outdated.

link text

Also i think this belongs in superuser.com

like image 112
Bella Avatar answered Dec 06 '22 08:12

Bella