LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-11-2012, 09:11 AM   #1
julirio
LQ Newbie
 
Registered: Oct 2012
Posts: 3

Rep: Reputation: Disabled
Opened sockets. Bash


Hi! I need to know how can I get the amount of open sockets per active processes iniciated in the current session.
However in order to get the number I can not use any command as netstat, I must find out the number by accessing to the /proc directory
per session refers to the relationship established between the user and the operating system after logging. (One terminal)
 
Old 10-13-2012, 05:13 AM   #2
kooru
Senior Member
 
Registered: Sep 2012
Posts: 1,385

Rep: Reputation: 273Reputation: 273Reputation: 273
Smile

Hi,

i don't know if i understand what you want, but have you tried lsof?
 
1 members found this post helpful.
Old 10-13-2012, 05:44 AM   #3
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
all file descriptors can be found under /proc/<PID>/fd ; each open socket has an associated descriptor and the entry looks somehow like this:
Code:
$ sudo readlink /proc/6196/fd/3
socket:[43113]
 
Old 10-13-2012, 05:48 AM   #4
julirio
LQ Newbie
 
Registered: Oct 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Ive tried that. But i must do it using a non-root user. So i can not use "sudo"
 
  


Reply


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
How is it opened? briansk12000 Linux - Newbie 2 04-01-2008 12:58 PM
Program to forward tcp sockets to unix domain sockets mikepol Linux - Networking 0 09-27-2007 10:49 AM
Sockets in bash valkarin Ubuntu 1 09-12-2007 08:30 PM
using sockets in a bash script? Thinking Programming 9 11-09-2005 08:25 AM
newly opened terminal shows bash-2.05$ instead of path jang Linux - General 6 01-18-2004 06:21 PM


All times are GMT -5. The time now is 12:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration