LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-16-2004, 04:51 PM   #1
slinky2004
Member
 
Registered: Oct 2004
Posts: 309

Rep: Reputation: 30
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
 
Old 10-16-2004, 05:22 PM   #2
vasudevadas
Member
 
Registered: Jul 2003
Location: Bedford, UK
Distribution: Slackware 11.0, LFS 6.1
Posts: 519

Rep: Reputation: 30
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!
 
Old 10-16-2004, 05:28 PM   #3
peyotl
LQ Newbie
 
Registered: Nov 2003
Location: poland
Distribution: Slackware-9.0
Posts: 22

Rep: Reputation: 15
You could try recursive searching with grep:

grep -R "famous" *

It also works for hidden files.
 
Old 10-16-2004, 05:32 PM   #4
slinky2004
Member
 
Registered: Oct 2004
Posts: 309

Original Poster
Rep: Reputation: 30
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
 
Old 10-16-2004, 06:08 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,965

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
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.
 
Old 10-16-2004, 06:16 PM   #6
vasudevadas
Member
 
Registered: Jul 2003
Location: Bedford, UK
Distribution: Slackware 11.0, LFS 6.1
Posts: 519

Rep: Reputation: 30
It installs it in that same place. I told the OP that in the first reply.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
grep ?? can grep us variables? DaFrEQ Linux - Software 4 09-14-2005 01:22 PM
help on grep!!!! sanjith11 Programming 5 01-20-2005 06:43 PM
What does rpm -qa |grep th* (as compared to rpm -qa |grep th) display? davidas Linux - Newbie 2 03-18-2004 02:35 AM
"Undeleting" data using grep, but get "grep: memory exhausted" error SammyK Linux - Software 2 03-13-2004 04:11 PM
ps -ef|grep -v root|grep apache<<result maelstrombob Linux - Newbie 1 09-24-2003 12:38 PM


All times are GMT -5. The time now is 02:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration