Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-01-2007, 02:53 PM   #1
Registered: Sep 2005
Location: New Jersey, USA
Distribution: Centos 7 , Linux Mint 18.1 Under VMware in Win7
Posts: 548

Rep: Reputation: 34
Find command with an IP address as the search aurgment

Hello all,

Looked at the man page for find but couldn't find an answer to this find question.

I want to search all files looking for the string

I tried find / -name '' -print and nothing comes up.

I'm sure this is wrong. Can anyone help me setting the find command up correctly to the his search?

Old 11-01-2007, 03:03 PM   #2
Registered: Oct 2007
Distribution: rhel, fedora, gentoo, ubuntu, freebsd
Posts: 104

Rep: Reputation: 17
find looks at the filename (ie: "tell me which files are named this"), as opposed to examining the inside the file.

You're looking for grep. I recommend reading the man page for it, and paying attention to the "recursive" part
Old 11-01-2007, 03:14 PM   #3
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
ind / -name '' -print
Should work if the name of the file is the URL number.

If the number is inside a file, modify your command:
find / -type f | xargs grep '216\.254\.93\.22'
The reason for the backslashes in the URL is that, upon expansion, the shell may interpret the dots as wildcards for any single character(s). It's then necessary to *excape* the expansion problem by using the backslash to have the dot interpreted as a dot.
Old 11-02-2007, 11:40 AM   #4
Registered: Sep 2005
Location: New Jersey, USA
Distribution: Centos 7 , Linux Mint 18.1 Under VMware in Win7
Posts: 548

Original Poster
Rep: Reputation: 34

Thanks bigrigdriver. Worked as advertised.


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
arp command find ethernet card address Fond_of_Opensource Linux - Networking 1 06-15-2007 06:22 AM
Find command using 2 search conditions nifflerX Linux - General 8 07-15-2005 01:37 PM
pattern search through find command. abhi Linux - Newbie 2 04-11-2005 10:31 AM
Command to find my IP address? mwheeler Linux - Networking 6 11-20-2004 05:26 AM
Command to find workstation IP address minno44 Linux - Newbie 2 10-08-2004 03:11 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:00 PM.

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