Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.


how I cat to filter out information about Unix Domain Sockets from netstat output without grep?
Is there some option for command (I not found it in man of netstat).

Thank you for ahead.

share|improve this question
1  
Why not use grep? –  BloodPhilia Aug 25 '10 at 17:33
    
Because it remains header of the section (few lines above "unix" record set) and it is too long every time to write it, and it is neccessary to do alias for this on each server. –  Rodnower Aug 25 '10 at 19:48

2 Answers 2

Use

netstat -46
share|improve this answer
    
This is not solution. In netstat --inet (also with -a swithch) I don't get the following line: "tcp 0 0 ::ffff:192.168.2.200:ssh ::ffff:192.168.2.100:44799 ESTABLISHED". But I get it without --inet –  Rodnower Aug 24 '10 at 17:46
    
Sorry, forgot about IPv6. Should work now –  whitequark Aug 24 '10 at 18:28
    
No, acording to man, netstat do not get this parameters... May be we told about different releases. I speak about: net-tools 1.60 netstat 1.42 (2001-04-15) for Linux. So I think that there is no such option. The only way is to use grep command. It is possible to put alias for this in /etc/bashrc. I put this answer with all this comments like accepted. Thank you any way. –  Rodnower Aug 24 '10 at 23:29
    
Strange. You can also try -A inet,inet6, or --inet --inet6. All of these options, including -46, are fully equivalent and work for me on netstat 1.42. Hope you'll fix anything that. –  whitequark Aug 25 '10 at 6:30
    
Yes, it is works :) –  Rodnower Aug 25 '10 at 7:09
up vote 0 down vote accepted
netstat -tulpn

-t tcp
-u udp
-l listenning
-p program name
-n use addresses rather then DNS names

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.