Answer the question
In order to leave comments, you need to log in
How to save netstat result?
when entering netstat -tulpn
in the console, the form is
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 XXXX:PORT 0.0.0.0:* LISTEN 3783/ssh
how to make the result output to the XXXX log file: PORT with instructions for saving the path and the ability to save to another server
Answer the question
In order to leave comments, you need to log in
Get the right column
Get the right column, trimming all headings and left rows
You can redirect to file >> file.txt at the end
netstat -tulpn > /home/user/file.log
or file.txt, whatever format and file path you want.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question