LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 12-19-2007, 02:36 PM   #1
swamprat
Member
 
Registered: Sep 2005
Location: New Jersey, (Which Exit LOL), USA
Distribution: Centos 6.7 Under VMware in Win7
Posts: 473

Rep: Reputation: 34
Find Command Need Help


Hello all,

I need some help with the find command.

I'm trying to find a name of a hosted web site on my Centos box.

Something like xyz.com.

I would like to search all files from the root down to see if 'xyz' is some here there and to display the results.

I tried this 'find / -name xyz -print but it didn't work, no results displayed.

I know for sure that xyz is there imbeded in some file.

Thanks.
 
Old 12-19-2007, 02:38 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,863

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
Quote:
Originally Posted by swamprat View Post
Hello all,

I need some help with the find command.

I'm trying to find a name of a hosted web site on my Centos box.

Something like xyz.com.

I would like to search all files from the root down to see if 'xyz' is some here there and to display the results.

I tried this 'find / -name xyz -print but it didn't work, no results displayed.

I know for sure that xyz is there imbeded in some file.

Thanks.
Try:

find / -iname "*xyz*" | less

--------------------------
Steve Stites
 
Old 12-19-2007, 02:57 PM   #3
zoranp
Member
 
Registered: Nov 2007
Location: Belgrade, RS
Distribution: Mandriva 2009.0 X86_64
Posts: 44

Rep: Reputation: 15
Or maybe

grep -i virtualhost `find /etc/ -name httpd.conf`
 
Old 12-19-2007, 03:11 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
ls -R / |grep xyz

Note that the -name option in find works on whole words only (or with a wild card)
grep, however, matches the specified fragment
 
Old 12-19-2007, 03:27 PM   #5
zoranp
Member
 
Registered: Nov 2007
Location: Belgrade, RS
Distribution: Mandriva 2009.0 X86_64
Posts: 44

Rep: Reputation: 15
Just a thought...

Hosted WEB site is probably virtual host described in httpd.conf.
 
Old 12-19-2007, 04:02 PM   #6
swamprat
Member
 
Registered: Sep 2005
Location: New Jersey, (Which Exit LOL), USA
Distribution: Centos 6.7 Under VMware in Win7
Posts: 473

Original Poster
Rep: Reputation: 34
Smile

Thank you all, very helpful...
 
  


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
Find/grep command to find matching files, print filename, then print matching content stefanlasiewski Programming 9 06-30-2016 06:30 PM
find command czy11421 Linux - Software 8 07-04-2007 10:17 PM
who to use find command NalinA Linux - Newbie 2 10-25-2005 09:08 AM
Find command ? hpladd Linux - Newbie 5 08-09-2005 10:42 PM
The find command Gins Linux - General 32 06-12-2005 03:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:14 PM.

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