P
P
psngut2017-05-31 12:31:54
SSH
psngut, 2017-05-31 12:31:54

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

2 answer(s)
S
Saboteur, 2017-05-31
@saboteur_kiev

Get the right column Get the right column, trimming all headings and left rows
You can redirect to file >> file.txt at the end

V
Vladimir Kuzin, 2017-05-31
@Bobson8

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 question

Ask a Question

731 491 924 answers to any question