If you are working on the setup of a new service and would like to allocate some port, you got to check if some other service uses that port. You can find out which process is using the particular port in Solaris by below tiny shell scripts. Following scripts will prompt you to enter the port number, and it will use pfiles command internally to give you the pid.

Create a file with the following

Save and change the permission of the file to be executable

Execute the file

Easy. Isn’t it? Interested in learning Linux administration? Check out these resources.