Sponsored Content
Top Forums Shell Programming and Scripting Displaying a field completely Post 302580015 by methyl on Wednesday 7th of December 2011 07:48:25 AM
Old 12-07-2011
Start with:
Code:
netstat -in | awk '{print $4}' | grep -v "Address"

Then look up the full name of those which are IP addresses (not MAC addresses) in /etc/hosts or DNS according to where netstat finds the name on your computer.
This User Gave Thanks to methyl For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Completely new...

Hi there, I am completely new to this forum but it say's it's for complete newbies too :) I have some questions: 1: I want to learn Linux and some basic Unix commands. Is it best to install a text version of Linux/Unix? (to get to know the commands, instead of a shell app) 2: Are there... (8 Replies)
Discussion started by: Mecallie
8 Replies

2. UNIX for Dummies Questions & Answers

Completely new to unix

Ive decided to take a trip over to unix and see how it is due to the perl compatabilities, What distro would you recommend? Im somewhat new to perl, and would like something with a "n00b-friendly" environment. Ive been running Linux boxes for some time now, and want to try a new os also. (3 Replies)
Discussion started by: idontdowindows
3 Replies

3. UNIX for Dummies Questions & Answers

COMPLETELY new to UNIX

So I am ridiculously new to UNIX. The closest thing to it I use is Mac OS X. Recently I downloaded OpenDarwin 7.2.1 just to see what it was like. I popped it into Vmware, installation and boot work well, and I login. Now I am presented with a console. I'm generally okay with command line... (2 Replies)
Discussion started by: sinister
2 Replies

4. Shell Programming and Scripting

Displaying lines of a file where the second field matches a pattern

Howdy. I know this is most likely possible using sed or awk or grep, most likely a combination of them together, but how would one go about running a grep like command on a file where you only try to match your pattern to the second field in a line, space delimited? Example: You are... (3 Replies)
Discussion started by: LordJezoX
3 Replies

5. UNIX for Dummies Questions & Answers

Completely new to UNIX

This is my first post here, I tried searching the forum and other sites as well - but I still couldn't figure out exactly what UNIX is. I mean like for C programming we Turbo C++ IDE, and in same way different platforms for other languages. What do we use for UNIX? I'm completely new to UNIX and... (2 Replies)
Discussion started by: j7x
2 Replies

6. What is on Your Mind?

And now for something completely the same

In honor of the anniversary of one of the best British shows (and memoriam of Graham Chapman)... npjOSLCR2hE 9ZlBUglE6Hc (1 Reply)
Discussion started by: pludi
1 Replies

7. Shell Programming and Scripting

Displaying the first field if the second field matches the pattern using Perl

Hi, I am trying with the below Perl command to print the first field when the second field matches the given pattern: perl -lane 'open F, "< myfile"; for $i (<F>) {chomp $i; if ($F =~ /patt$/) {my $f = (split(" ", $i)); print "$f";}} close F' dummy_file I know I can achieve the same with the... (7 Replies)
Discussion started by: royalibrahim
7 Replies

8. UNIX for Dummies Questions & Answers

Displaying field of NR, not the line #

Within AWK, how do you display a field of NR? Here's my code: awk '(NR>1) && (P1=$1-w)>=100000 {print "increase of" " " P1*.0000179," " "kW at" " " 'NR*60/431900' " " "minutes" "\n" "change from" " " 'NR-10($1)' " " "kW to" " " 'NR+70($1)' "\n"}{w=$1}' filename I can change NR and print... (3 Replies)
Discussion started by: markymarkg123
3 Replies

9. Solaris

11.2 not shutting down completely

I just installed this 11.2 ver and when I tell it to shutdown it takes for ever then just hangs with this just a little bit of that red line left to go, then it just sits there like forever until I get tired of looking at it then force a shutdown by holding my power button down until my laptop... (8 Replies)
Discussion started by: userx-bw
8 Replies
inet_type(4)							   File Formats 						      inet_type(4)

NAME
inet_type - default Internet protocol type SYNOPSIS
/etc/default/inet_type DESCRIPTION
The inet_type file defines the default IP protocol to use. Currently this file is only used by the ifconfig(1M) and netstat(1M) commands. The inet_type file can contain a number of <variable>=<value> lines. Currently, the only variable defined is DEFAULT_IP, which can be assigned a value of IP_VERSION4, IP_VERSION6, or BOTH. The output displayed by the ifconfig and netstat commands can be controlled by the value of DEFAULT_IP set in inet_type file. By default, both commands display the IPv4 and IPv6 information available on the system. The user can choose to suppress display of IPv6 information by setting the value of DEFAULT_IP. The following shows the possible values for DEFAULT_IP and the resulting ifconfig and netstat output that will be displayed: IP_VERSION4 Displays only IPv4 related information. The output displayed is backward compatible with older versions of the ifconfig(1M) and netstat(1M) commands. IP_VERSION6 Displays both IPv4 and IPv6 related information for ifconfig and netstat. BOTH Displays both IPv4 and IPv6 related information for ifconfig and netstat. The command-line options to the ifconfig and netstat commands override the effect of DEFAULT_IP as set in the inet_type file. For example, even if the value of DEFAULT_IP is IP_VERSION4, the command example% ifconfig -a6 will display all IPv6 interfaces. EXAMPLES
Example 1: Suppressing IPv6 Related Output This is what the inet_type file must contain if you want to suppress IPv6 related output: DEFAULT_IP=IP_VERSION4 SEE ALSO
ifconfig(1M), netstat(1M) SunOS 5.10 16 Jun 1999 inet_type(4)
All times are GMT -4. The time now is 03:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy