198k views
1 vote
You are using the grep command, but it is only searching through files in your immediate home directory. What option enables you to search through subdirectories below your home directory ?

User Goz
by
3.4k points

1 Answer

3 votes

Answer:

grep -r

Step-by-step explanation:

Grep command is used in Linux and Mac platforms to search for some words or texts within files on our computer system and print out those texts that match our specified text pattern. It stands for Global Regular Expression Print. In a practical situation, if we wanted to search for a sub directory in a large project that has a lot of files and sub-directories, we can use the –recursive (-r) search option. The grep –r command will search for all files in the current directory and will try to pull out the specified word or text in all of its sub-directories.

User Daniel Jackson
by
3.1k points