LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   grep help? (https://www.linuxquestions.org/questions/linux-newbie-8/grep-help-243529/)

slinky2004 10-16-2004 03:51 PM

grep help?
 
i'm running slackware linux and everytime i open the console, it will print some words of wisdom, advice, jokes, etc. well, i wanted to find out where that file was so i decided i'd do a grep for one of the more unique words in one of the quotes. so i did:
Code:

grep "famous" . ./\.*
from the root directory as root. the "./\.*" is to search for hidden files also, since it's likely that the file containing these quotes is hidden. it's been running for a long time and nothing has happened yet. can somebody tell me what i should do to do a grep search through my entire filesystem(even hidden files and folders) for a specific string of text?

ps. if you know the location of the file that holds those quotes, thats great , id like to know, but this is really more about learning how to use grep than really finding that file.

thanx ;)

vasudevadas 10-16-2004 04:22 PM

Well, you could try:

find . * -exec grep "famous" {} \; -print

and then

find . .* -exec grep "famous" {} \; -print

for all the hidden files. But it'll take ages.

However, I can tell you that the files you are looking for are in /usr/share/games/fortunes. That'll probably save you some time!

peyotl 10-16-2004 04:28 PM

You could try recursive searching with grep:

grep -R "famous" *

It also works for hidden files.

slinky2004 10-16-2004 04:32 PM

sometimes it hangs after a while. for example, if i do that first command you gave me in my root directory it will go through ./dev for a long time and then just stop after a while

michaelk 10-16-2004 05:08 PM

Its an old console game called fortune. The default database location is /usr/share/games/fortunes. However, I do not know where Slack installs it.

http://www.die.net/doc/linux/man/man6/fortune.6.html

I'm not a real expert on the grep statement. I would say its going to take awhile.

vasudevadas 10-16-2004 05:16 PM

It installs it in that same place. I told the OP that in the first reply.


All times are GMT -5. The time now is 10:34 AM.