Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to grep only IP 10.76.178.xx? Post 302880731 by fikamw on Monday 23rd of December 2013 03:08:46 AM
Old 12-23-2013
How to grep only IP 10.76.178.xx?

hallo, im newbie here Smilie

i have problem when processing some data, i want to get and filter only the IP that start with 10.76.178.xx from both local and peer IP.

here is the data example :
Code:
Local IP=10.68.178.1, Peer IP=10.76.178.37
Local IP=10.68.178.1, Peer IP=10.76.178.37
Local IP=10.68.178.3, Peer IP=10.76.178.38
Local IP=10.68.178.1, Peer IP=10.76.178.38
Local IP=10.68.178.3, Peer IP=10.76.178.38
Local IP=10.68.178.1, Peer IP=10.76.178.38
Local IP=10.76.178.38, Peer IP=10.68.178.3
Local IP=10.76.178.37, Peer IP=10.68.178.1
Local IP=10.76.178.38, Peer IP=10.68.178.3
Local IP=10.76.178.37, Peer IP=10.68.178.1

how to get them ya?
i try use basic
Code:
grep "10.76.178" [filename]

and
Code:
grep -oP "10.76.178" [filename]

can not get what i want.Smilie

result :
Code:
10.76.178
10.76.178
10.76.178
10.76.178
10.76.178
10.76.178
10.76.178
10.76.178
10.76.178
10.76.178

please kindly to help this newbie. Smilie

thank you Smilie
 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else

Hi Guys, I need to set the value of $7 to zero in case $7 is NULL. I've tried the below command but doesn't work. Any ideas. thanks guys. MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else { print $7}}' ` Harby. (4 Replies)
Discussion started by: hariza
4 Replies

2. UNIX for Dummies Questions & Answers

| help | unix | grep (GNU grep) 2.5.1 | advanced regex syntax

Hello, I'm working on unix with grep (GNU grep) 2.5.1. I'm going through some of the newer regex syntax using Regular Expression Reference - Advanced Syntax a guide. ls -aLl /bin | grep "\(x\)" Which works, just highlights 'x' where ever, when ever. I'm trying to to get (?:) to work but... (4 Replies)
Discussion started by: MykC
4 Replies

3. Shell Programming and Scripting

AWK/GREP: grep only lines starting with integer

I have an input file 12.4 1.72849432773174e+01 -7.74784188610632e+01 12.5 9.59432114416327e-01 -7.87018212757537e+01 15.6 5.20139995965960e-01 -5.61612429666624e+01 29.3 3.76696387248366e+00 -7.42896194101892e+01 32.1 1.86899877018077e+01 -7.56508762501408e+01 35 6.98857157014640e+00... (2 Replies)
Discussion started by: chrisjorg
2 Replies

4. UNIX for Dummies Questions & Answers

Bash - CLI - grep - Passing result to grep through pipe

Hello. I want to get all modules which are loaded and which name are exactly 2 characters long and not more than 2 characters and begin with "nv" lsmod | (e)grep '^nv???????????? I want to get all modules which are loaded and which name begin with "nv" and are 2 to 7 characters long ... (1 Reply)
Discussion started by: jcdole
1 Replies

5. UNIX for Advanced & Expert Users

HPUX_SCHED_NOAGE 178

We are getting the error below in Linux - Oracle 11g Bench as below: Last System configure: NOTE: Fri May 18 17:34:32 IST 2012: creating SPFILE ... CREATE SPFILE='<path>/ORACLE/admin/eml100_1/pfile/spfile.ora.UPD' FROM PFILE='<path>/ORACLE/admin/eml100_1/pfile/config.ora' * ERROR at line... (2 Replies)
Discussion started by: ambarginni
2 Replies

6. Shell Programming and Scripting

Inconsistent `ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l`

i have this line of code that looks for the same file if it is currently running and returns the count. `ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l` basically it is assigned to a variable ISRUNNING=`ps -eaf -o args | grep -i sfs_pcard_load_file.ksh |... (6 Replies)
Discussion started by: wtolentino
6 Replies
IO::Socket::UNIX(3pm)					 Perl Programmers Reference Guide				     IO::Socket::UNIX(3pm)

NAME
IO::Socket::UNIX - Object interface for AF_UNIX domain sockets SYNOPSIS
use IO::Socket::UNIX; DESCRIPTION
"IO::Socket::UNIX" provides an object interface to creating and using sockets in the AF_UNIX domain. It is built upon the IO::Socket interface and inherits all the methods defined by IO::Socket. CONSTRUCTOR
new ( [ARGS] ) Creates an "IO::Socket::UNIX" object, which is a reference to a newly created symbol (see the "Symbol" package). "new" optionally takes arguments, these arguments are in key-value pairs. In addition to the key-value pairs accepted by IO::Socket, "IO::Socket::UNIX" provides. Type Type of socket (eg SOCK_STREAM or SOCK_DGRAM) Local Path to local fifo Peer Path to peer fifo Listen Create a listen socket If the constructor is only passed a single argument, it is assumed to be a "Peer" specification. NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE As of VERSION 1.18 all IO::Socket objects have autoflush turned on by default. This was not the case with earlier releases. NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE METHODS
hostpath() Returns the pathname to the fifo at the local end peerpath() Returns the pathanme to the fifo at the peer end SEE ALSO
Socket, IO::Socket AUTHOR
Graham Barr. Currently maintained by the Perl Porters. Please report all bugs to <perlbug@perl.org>. COPYRIGHT
Copyright (c) 1996-8 Graham Barr <gbarr@pobox.com>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2014-01-06 IO::Socket::UNIX(3pm)
All times are GMT -4. The time now is 07:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy