Avatar of LindaC
LindaC
Flag for Puerto Rico asked on

Script needed to see the ports being used by the Aix server.

I'am expecting something like this:

"Run this script as root so that you will have in a text file, the ports that are being used"
After you add the proper comments to this text file  adding this to each line (example)
    # Comment-This port is for Oracle Apex
then you run this  other script to add the content of this text file to the /etc/services.
This must be run by root.
Unix OS

Avatar of undefined
Last Comment
LindaC

8/22/2022 - Mon
omarfarid

you may look at the output of command like

netstat -an

can you elaborate on the requirement?
LindaC

ASKER
It will suffice if I can get a text file with all the ports that are in use on the server.
The other ports that are not in the text files will be closed.
LindaC

ASKER
Only the text files with the ports that are being used.
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
woolmilkporc

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
omarfarid

try this

netstat -an | egrep -i "list|estab|connect" > file

this should give you idea about ports used on the system
LindaC

ASKER
Does this udp means that they are being used?

udp        0      0  *.46656                *.*
claropr-oem-oracle:/oracle/diag/rdbms/oem11g/oem11g/trace> an|grep 14253
udp        0      0  *.14253                *.*
ports-used.bmp
woolmilkporc

udp is the protocol being used (User Datagram Protocol)

The simple fact that the port appears in the output of "netstat -an" means that it's open and in use.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
LindaC

ASKER
Thank you.