Finding an IP address


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Finding an IP address
# 1  
Old 08-31-2007
Finding an IP address

Using either

% nslookup www.computerhope.com

or

% host www.computerhope.com

Is there a way to single out only the IP address and not all the other information that these commands return by using the options or something of this nature.

For Example I would like to do this

Echo "computerhope.com IP address is X" Where X is the IP address

Last edited by Perderabo; 08-31-2007 at 08:42 AM.. Reason: Undo linked addresses
# 2  
Old 08-31-2007
Try:
Code:
Echo "computerhope.com IP address is `nslookup www.computerhope.com | grep "Address" | nawk '{printf $2}'`"

P.S. The Red marks are not single quotes, they are on the same key as [~] .
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

C program to detect duplicate ip address if any after assigning ip address to ethernet interface

Hi , Could someone let me know how to detect duplicate ip address after assigning ip address to ethernet interface using c program (3 Replies)
Discussion started by: Gopi Krishna P
3 Replies

2. Shell Programming and Scripting

Finding if my IP address belongs in a Class C group

I need help with a tcl code. I have a variable "myIP" which reads IP address from socket. How do I use regex to find out if it belongs to a group for e.g., 50.65.75.240/28 or 50.65.75.128/25 etc. (2 Replies)
Discussion started by: ampak
2 Replies

3. UNIX for Dummies Questions & Answers

Finding e-mail address using "find" command

any useful command to find and e-mail address hardcoded into a cfg file on an specific server? I already tried with:: find . -type f | xargs grep -l "nobody@foundstone.com" Thanks!! (1 Reply)
Discussion started by: JLo5621
1 Replies

4. UNIX for Dummies Questions & Answers

Panic kernal-mode address fault on user address 0x14

:) Firstly Hi all!!, im NEW!! and on here hoping that someone might be able to offer me some help... i have a server that keeps crashing every few days with the error message: PANIC KERNAL-MODE ADDRESS FAULT ON USER ADDRESS 0X14 KERNAL PAGE FAULT FROM (CS:EIP)=(100:EF71B5BD) EAX=EF822000... (10 Replies)
Discussion started by: Twix
10 Replies

5. Filesystems, Disks and Memory

Finding IP address of the system hosting an NAS

Hi, On Solaris 5.8 when I run the command df -F nfs one of the outputs I am getting is: pun-filer-01:/vol/Unix/punehome/vineetd out of which "pun-filer-01" is hostname of the machine on which the NAS device is hosted and /vol/Unix/punehome/vineetd is the mount point. I am interested in... (2 Replies)
Discussion started by: vineetd
2 Replies

6. Shell Programming and Scripting

Finding an email address

Hi all, I have a file with X number of lines. Somewhere within each line will be an email address following the format: <telephone_number>@domain.net Each line is not a set length and there are no delimiters to work with. I want to write a script that extracts the telephone number... (3 Replies)
Discussion started by: mandriver
3 Replies

7. UNIX for Dummies Questions & Answers

Finding IP address of the workstation

Hi, I have the following requirement. I want to configure in the .profile file of my user id in such a way that it loads a particular set of command when i log in from a particular machine and another set when i log into the server from a different machine. What is the command to get the... (1 Reply)
Discussion started by: Vijay Srinivasa
1 Replies

8. IP Networking

How to Achive IP address through MAC(Ethernet) address

Hi sir, i want to make such programe which takes MAC(Ethernet) address of any host & give me its IP address....... but i'm nt getting that how i can pass the MAC address to Frame........ Please give me an idea for making such program... Thanks & regards Krishna (3 Replies)
Discussion started by: krishnacins
3 Replies

9. UNIX for Dummies Questions & Answers

Finding LocalHost IP Address

I am writing a program that need to be run on several machines. I am running UNIX and wanted to know if there is a command similar to ipconfig (in DOS) that would return the IP Address of the machine that I am working on. (Not just the loopback address of 127.0.0.1). (1 Reply)
Discussion started by: hazard0007
1 Replies

10. IP Networking

Finding an x25 address for a server

I am trying to find the x25 address of a server. Presumably this is stored in some sort of config file - and while I can find the IP and OSI addresses - I cannot work out where to find the x25 address.....any ideas? (Unix on Solaris) (1 Reply)
Discussion started by: peter.herlihy
1 Replies
Login or Register to Ask a Question