Wednesday, May 8, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 1471  / 3 Years ago, sat, november 20, 2021, 11:35:26

I am searching for a word, in this case "hehe" that is located in the file findTest



by using grep, but when i initiate the search:



grep -r "hehe"


or



grep -lr "hehe"


it starts but after 5 min waiting nothing happens, even if i am in the same directory as the file.
the only way i get a results straight away is being in the same directory and typing:



grep "hehe" findTest 


Are their any other ways to search for a word? even if not in the same directory.


More From » directory

 Answers
2

The grep command expects either a file (or, in the case of -r, directory) name or input from the standard input stream - it's just sitting waiting for you so supply one or the other.



As an alternative to typing the name of the current directory, you can use the shorthand . or ./ i.e.



grep -r "hehe" .


or



grep -r "hehe" ./

[#24764] Sunday, November 21, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tionpromoti

Total Points: 14
Total Questions: 112
Total Answers: 113

Location: Tonga
Member since Tue, Nov 30, 2021
2 Years ago
tionpromoti questions
Fri, Apr 15, 22, 03:58, 2 Years ago
Tue, Jun 1, 21, 23:05, 3 Years ago
Mon, Jul 5, 21, 06:11, 3 Years ago
;