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 12-19-2007, 01:36 PM   #1
swamprat
Member
 
Registered: Sep 2005
Location: New Jersey, USA
Distribution: Centos 7 , Linux Mint 18.1 Under VMware in Windows 10
Posts: 554

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, 01:38 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,268

Rep: Reputation: 530Reputation: 530Reputation: 530Reputation: 530Reputation: 530Reputation: 530
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, 01: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, 02:11 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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, 02: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, 03:02 PM   #6
swamprat
Member
 
Registered: Sep 2005
Location: New Jersey, USA
Distribution: Centos 7 , Linux Mint 18.1 Under VMware in Windows 10
Posts: 554

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 05:30 PM
find command czy11421 Linux - Software 8 07-04-2007 09:17 PM
who to use find command NalinA Linux - Newbie 2 10-25-2005 08:08 AM
Find command ? hpladd Linux - Newbie 5 08-09-2005 09:42 PM
The find command Gins Linux - General 32 06-12-2005 02:20 PM

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

All times are GMT -5. The time now is 02:34 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
Open Source Consulting | Domain Registration