Welcome to the most active Linux Forum on the web.
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 05-27-2003, 06:34 PM   #1
Registered: Jan 2003
Location: nearby switzerland
Distribution: Suse 8.0 / Suse 9.0 / Slackware 9.1 / Debian Sarge testing / Gentoo 1.4.10
Posts: 165

Rep: Reputation: 30
cut / awk command??

Hi everybody

i got a question regarding line based searching
if i have file which looks for example like this:

Host: () bla 123
Host: () bla 123
Host: () bla 123
Host: () bla 123
Host: () bla 123
how am i able to extract only the ips??
afterwards it should look like this:

cat file | grep Host: doesn't work and couldn't find any option to extract the ips

i heard of a awk command but don't know how the heck to use it to realize this

Any help or hint would be apreciated

Friendly Regards

Old 05-27-2003, 06:46 PM   #2
Registered: Aug 2002
Location: Portland, OR
Distribution: Xubuntu
Posts: 135

Rep: Reputation: 15
$ awk '{print $2}' filename



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
bash cut command to get df percentage nutthick Programming 8 12-16-2010 12:02 PM
How do I cut out a specific piece of a html page (using sed/awk or similar)? bomix Linux - General 2 10-08-2005 05:30 PM
finger and cut command Craig Bowes Linux - Newbie 3 10-09-2004 01:49 PM
Cut Command Help!! fooforon Programming 2 02-05-2004 11:09 AM
Easy: Help with Cut command Krash_io Programming 4 07-17-2002 03:29 AM > Forums > Linux Forums > Linux - Newbie

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