Results 1 to 6 of 6

Thread: Search IP under Red Hat

  1. #1
    Join Date
    Apr 2008
    Posts
    264

    Search IP under Red Hat

    Hello
    I used the command -
    Code:
    grep-lir MON_IP / directory
    to search for IP all the files / directory. But I wanted to know if there was a command that allows me to do research in all files from my server (from the root without having to specify a directory). Thank you in advance.
    Last edited by spuff; 18-12-2009 at 01:11 PM.

  2. #2
    Join Date
    Apr 2008
    Posts
    3,424

    Re: Search IP under Red Hat

    Hi
    You may try the following command in your system terminal as a root user
    Code:
    find /-type f-exec grep-li Example () \;
    Otherwise, your ip addresses are configured in
    Code:
    / etc/sysconfig/network-scripts/ifcfg- *
    Any more help needed, do post back.

  3. #3
    Join Date
    Apr 2008
    Posts
    264

    Re: Search IP under Red Hat

    Hi
    I just used the command recommended by you, and unfortunately I got an error
    Code:
    Glibc detected realloc (): 
    find grep terminated by signal 6
    I know that IP is located in / etc/sysconfig/network-scripts/ifcfg- *. In fact I created an alias for my first IP. I changed my gateway in / etc / sysconfig / network but when switching to my new IP I realized that the service does not work because, the old IP is to back hard in lots of files.

  4. #4
    Join Date
    Apr 2008
    Posts
    3,424

    Re: Search IP under Red Hat

    Hi
    I just used the command recommended by you, and unfortunately I got an error
    Glibc detected realloc ():
    find grep terminated by signal 6
    I do not think that the command will return an error, because the command is created to work like that.

  5. #5
    Join Date
    Jan 2006
    Posts
    3,792

    Re: Search IP under Red Hat

    Hello
    I do not think that the command will return an error, because the command is created to work like that.
    Actually at my house this command works without problem. But why should we add () \ to the end. I think there is no need for such syntax.

  6. #6
    Join Date
    Feb 2008
    Posts
    2,635

    Re: Search IP under Red Hat

    Hi
    () - Is the ground captured by the find command for a given iteration i.
    \; - Can signal the end of the block-exec
    Example:
    test $ ls
    tx1
    tx2
    tx3
    test $ find. -type f-exec echo "file:" () \;
    file: tx1
    file: tx2
    file: tx3
    Hope this will help you.

Similar Threads

  1. Replies: 6
    Last Post: 08-06-2011, 11:36 PM
  2. Replies: 4
    Last Post: 05-04-2011, 04:29 AM
  3. Replies: 1
    Last Post: 19-03-2009, 05:55 PM
  4. Search Companion text search folder doesn't find all files
    By Hrishia in forum Windows XP Support
    Replies: 2
    Last Post: 27-11-2008, 10:16 PM
  5. Replies: 0
    Last Post: 07-11-2008, 02:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,715,747,368.50380 seconds with 17 queries