The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to write application for 32 com port amitpansuria High Level Programming 6 08-09-2007 10:50 PM
disabled telnet now need port 23 or port 22 panzerkw SUN Solaris 3 03-05-2007 11:08 AM
How can I check what port addresses used the application eykyn17 IP Networking 1 02-16-2006 08:58 AM
which port to write my server application? rraajjiibb UNIX for Advanced & Expert Users 0 12-18-2005 10:42 PM
BitTorrent port 6969 blocked... how to get around the blocked port PenguinDevil IP Networking 1 05-05-2004 08:03 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-21-2006
Registered User
 

Join Date: Aug 2005
Posts: 225
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
What application is using the port

Hello
im using sunos im trying to lock down application that taking my port
when Im doing "netstat –in | grep 8080"
Is gives me the indication that the port is taken but no indication who is taken the port.
How can I find out who is taking my port?


Thanks allot
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-21-2006
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,439
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
The simplets way is to use lsof.
Reply With Quote
  #3 (permalink)  
Old 05-21-2006
Moderator
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,387
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
On Linux at least, you should also be able to do a

netstat -tlnp | grep 8080

as root to check the process that is holding the port open.
Reply With Quote
  #4 (permalink)  
Old 05-21-2006
Registered User
 

Join Date: Aug 2005
Posts: 225
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
what is lsof? and how can i use it?
by the way the linux way dont work on sunOs
thanks
Reply With Quote
  #5 (permalink)  
Old 05-21-2006
Registered User
 

Join Date: Aug 2005
Posts: 225
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
now when im checking in sunos i dont see this tool , i need standart sulotion
whitout installing any thing ...
Reply With Quote
  #6 (permalink)  
Old 05-21-2006
Registered User
 

Join Date: May 2006
Posts: 8
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
check out the /etc/services and /etc/inetd.conf
files for the possible s/w and their assigned ports...
Reply With Quote
  #7 (permalink)  
Old 05-21-2006
Registered User
 

Join Date: Aug 2005
Posts: 225
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Thanks for the fast reply ..
Correct me if im wrong.. but those files show me process that using ports
ok so its also way to know but what is the port that is taken don’t exists in the list ?
Reply With Quote
  #8 (permalink)  
Old 05-22-2006
Registered User
 

Join Date: May 2005
Posts: 23
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Look the follow text :

List Open Files: lsof and fuser
The function of these commands is very similar. The goal is to determine what processes have certain files open. lsof is freeware and thus freely compilable under all Unixes. It is available by default under Linux only.

The main difference between lsof and fuser is that lsof takes both files/filesystems and PIDs as arguments whereas fuser only accepts files/filesystems.

lsof:
lsof stands for list open files. It lists information about files that are currently open by processes.
In the absence of any options, lsof lists all open files belonging to all active processes

To list all open files for login name ``abe'', or user ID 1234 you would use the -u option. To list files being used by process 456, process 123, or process 789, you would use the -p flag. Putting these criteria together, we would have a command that looks like this:

lsof -p 456,123,789 -u 1234,abe

The command to list all open files on device /dev/hd4, would look like this:

lsof /dev/hd4

To find the process that has /u/abe/foo open, use:

lsof /u/abe/foo

fuser:
fuser is more widely available (under AIX, HP-UX, IRIX, Linux, Solaris, Tru64 UNIX, and others) and can only be run as root. It displays the process ID numbers of processes using the specified files or file systems. In the default display mode, each file name is followed by a letter denoting the type of access (these codes differ from vendor to vendor):
a if the process is using the file as its trace file in /proc (IRIX)
c if the process is using the file as its current directory
e if the process is using the file as the executable being run
f if the process is using the file as an open file (Linux)
m if the process is using the file as a mmaped or shared lib (Linux)
o if the process is using the file as an open file (IRIX, Solaris, Tru64 UNIX))
p if the process is using the file as the parent of its current directory (Tru64 UNIX)
r if the process is using the file as root directory
s if the process is using the file as a shared lib (AIX)
t if the process is using the file as its text file (Solaris)
y if the process is using the file as its controlling terminal (IRIX)
Reply With Quote
Google UNIX.COM
Reply

Tags
linux

Thread Tools
Display Modes


The 50 most popular UNIX and Linux searches.
Google Search Cloud for The UNIX and Linux Forums
421 service not available, remote server has closed connection ^m automate ftp autosys awk trim bash eval bash exec bash for loop command copy/move folder in unix couldn't set locale correctly curses.h cut command in unix export command in unix find grep find mtime find null character in a unix file grep multiple lines grep or grep recursive hp-ux ifconfig inaddr_any inappropriate ioctl for device lynx javascript mailx attachment mget mtime ping port remove first character from string in k shell replace space by comma , perl script rsync ftp scp recursive segmentation fault(coredump) sftp script snoop unix solaris change ip address stale nfs file handle syn_sent tar exclude tar extract to folder test: argument expected unix unix .profile unix forum unix forums unix internals unix mtime unix simulator unix.com vi substitute while loop within while loop shell script


All times are GMT -7. The time now is 03:35 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101