majik
28 February 2024 22:27
1
i have an open port i’m curious about
0.0.0.0:41615
neither netstat, lsof, fuser nor ss can tell me what process owns that port
$ sudo netstat -nlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 907/cupsd
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 860/dnscrypt-proxy
tcp6 0 0 ::1:631 :::* LISTEN 907/cupsd
udp 0 0 127.0.0.1:53 0.0.0.0:* 860/dnscrypt-proxy
udp 0 0 0.0.0.0:41615 0.0.0.0:* -
udp6 0 0 :::41615 :::* -
Is this port listed in /etc/services?
Are you using python & tensorflow? In a bug report there’s something like yours:
INFO:tensorflow:Using local port 41615
I0627 23:02:57.102149 139801719478080 test_util.py:3796] Using local port 41615
2023-06-27 23:02:57.103351: I tensorflow/core/data/service/worker_impl.cc:186] Worker registered with dispatcher running at localhost:43055
2023-06-27 23:02:57.103477: I tensorflow/core/data/service/server_lib.cc:82] Started tf.data WorkerServer running at 0.0.0.0:41615
opened 03:34PM - 28 Jun 23 UTC
stat:awaiting tensorflower
type:bug
type:build/install
subtype: ubuntu/linux
TF 2.13
<details><summary>Click to expand!</summary>
### Issue Type
Bug
### Have y… ou reproduced the bug with TF nightly?
Yes
### Source
source
### Tensorflow Version
git HEAD
### Custom Code
No
### OS Platform and Distribution
Ubuntu 20.04
### Mobile device
n/a
### Python version
3.9.16
### Bazel version
6.1.0
### GCC/Compiler version
10.2.1
### CUDA/cuDNN version
n/a
### GPU model and memory
n/a
### Current Behaviour?
//tensorflow/python/data/experimental/kernel_tests/service:local_workers_test sometimes fails or timeouts.
x86 log
https://source.cloud.google.com/results/invocations/e41a9dd4-19a3-4298-b34f-6a32eca50e08/log
AARCH64 log
https://github.com/tensorflow/tensorflow/actions/runs/5383187293/jobs/9769619751#step:5:8335
### Standalone code to reproduce the issue
```shell
bazel --bazelrc=/usertools/cpu.bazelrc test --config=pycpp --config=build_event_export --remote_cache=https://storage.googleapis.com/tensorflow-devinfra-bazel-cache/norbe --google_default_credentials
```
### Relevant log output
```shell
INFO: From Testing //tensorflow/python/data/experimental/kernel_tests/service:local_workers_test (shard 1 of 24):
==================== Test output for //tensorflow/python/data/experimental/kernel_tests/service:local_workers_test (shard 1 of 24):
2023-06-27 23:02:53.397107: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2023-06-27 23:02:53.528865: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Running tests under Python 3.9.17: /usr/bin/python3
[ RUN ] LocalTaskGarbageCollectTest.testMultipleEpochsSharedJob_test_mode_eager_tfapiversion_1_numremoteworkers_0
[ SKIPPED ] LocalTaskGarbageCollectTest.testMultipleEpochsSharedJob_test_mode_eager_tfapiversion_1_numremoteworkers_0
[ RUN ] LocalTaskGarbageCollectTest.testReadFromDeletedTask_test_mode_eager_tfapiversion_1_numremoteworkers_0
[ SKIPPED ] LocalTaskGarbageCollectTest.testReadFromDeletedTask_test_mode_eager_tfapiversion_1_numremoteworkers_0
[ RUN ] LocalWorkersTest.testAnonymousJobWithDifferentTargetWorkers_test_mode_graph_tfapiversion_2
INFO:tensorflow:Using local port 43055
I0627 23:02:57.097305 139801719478080 test_util.py:3796] Using local port 43055
2023-06-27 23:02:57.099356: I tensorflow/core/data/service/dispatcher_impl.cc:223] Attempting to restore dispatcher state from journal in /root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/_tmp/dbc16dd8be682dbdabf0b589b8e98f16j99fj6xd/tmptm5ix2lv/tf_data_dispatcher_journal
2023-06-27 23:02:57.099421: I tensorflow/core/data/service/dispatcher_impl.cc:230] No journal found. Starting dispatcher from new state.
2023-06-27 23:02:57.099574: I tensorflow/core/data/service/server_lib.cc:82] Started tf.data DispatchServer running at 0.0.0.0:43055
INFO:tensorflow:Using local port 44899
I0627 23:02:57.099842 139801719478080 test_util.py:3796] Using local port 44899
2023-06-27 23:02:57.101683: I tensorflow/core/data/service/worker_impl.cc:186] Worker registered with dispatcher running at localhost:43055
2023-06-27 23:02:57.101828: I tensorflow/core/data/service/server_lib.cc:82] Started tf.data WorkerServer running at 0.0.0.0:44899
INFO:tensorflow:Using local port 41615
I0627 23:02:57.102149 139801719478080 test_util.py:3796] Using local port 41615
2023-06-27 23:02:57.103351: I tensorflow/core/data/service/worker_impl.cc:186] Worker registered with dispatcher running at localhost:43055
2023-06-27 23:02:57.103477: I tensorflow/core/data/service/server_lib.cc:82] Started tf.data WorkerServer running at 0.0.0.0:41615
INFO:tensorflow:Using local port 37691
I0627 23:02:57.103664 139801719478080 test_util.py:3796] Using local port 37691
2023-06-27 23:02:57.104726: I tensorflow/core/data/service/worker_impl.cc:186] Worker registered with dispatcher running at localhost:43055
2023-06-27 23:02:57.104854: I tensorflow/core/data/service/server_lib.cc:82] Started tf.data WorkerServer running at 0.0.0.0:37691
INFO:tensorflow:Using local port 39883
I0627 23:02:57.107191 139801719478080 test_util.py:3796] Using local port 39883
2023-06-27 23:02:57.584682: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2023-06-27 23:02:57.619502: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2023-06-27 23:02:57.634234: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-06-27 23:02:57.788004: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-06-27 23:02:59.175789: I tensorflow/core/data/service/worker_impl.cc:186] Worker registered with dispatcher running at localhost:43055
2023-06-27 23:02:59.176006: I tensorflow/core/data/service/server_lib.cc:82] Started tf.data WorkerServer running at 0.0.0.0:39883
INFO:tensorflow:Using local port 34849
I0627 23:02:59.176878 139801719478080 test_util.py:3796] Using local port 34849
2023-06-27 23:02:59.252223: I tensorflow/core/data/service/worker_impl.cc:186] Worker registered with dispatcher running at localhost:43055
2023-06-27 23:02:59.252462: I tensorflow/core/data/service/server_lib.cc:82] Started tf.data WorkerServer running at 0.0.0.0:34849
INFO:tensorflow:Using local port 46439
I0627 23:02:59.253159 139801719478080 test_util.py:3796] Using local port 46439
2023-06-27 23:02:59.287010: I tensorflow/core/data/service/worker_impl.cc:186] Worker registered with dispatcher running at localhost:43055
2023-06-27 23:02:59.287229: I tensorflow/core/data/service/server_lib.cc:82] Started tf.data WorkerServer running at 0.0.0.0:46439
/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/data/ops/dataset_ops.py:458: UserWarning: To make it possible to preserve tf.data options across serialization boundaries, their implementation has moved to be part of the TensorFlow graph. As a consequence, the options value is in general no longer known at graph construction time. Invoking this method in graph mode retains the legacy behavior of the original implementation, but note that the returned value might not reflect the actual value of the options.
warnings.warn("To make it possible to preserve tf.data options across "
WARNING:tensorflow:From /usr/lib/python3.9/contextlib.py:87: TensorFlowTestCase.test_session (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `self.session()` or `self.cached_session()` instead.
W0627 23:02:59.486639 139801719478080 deprecation.py:364] From /usr/lib/python3.9/contextlib.py:87: TensorFlowTestCase.test_session (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `self.session()` or `self.cached_session()` instead.
2023-06-27 23:02:59.508867: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:382] MLIR V1 optimization pass is not enabled
-- Test timed out at 2023-06-27 23:07:52 UTC --
Current thread 0x00007f261fd41740 (most recent call first):
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/client/session.py", line 1477 in _call_tf_sessionrun
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/client/session.py", line 1384 in _run_fn
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/client/session.py", line 1401 in _do_call
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/client/session.py", line 1394 in _do_run
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/client/session.py", line 1214 in _run
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/client/session.py", line 971 in run
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/framework/test_util.py", line 2061 in run
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/framework/test_util.py", line 2691 in evaluate
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/data/kernel_tests/test_base.py", line 237 in assertDatasetProduces
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.py", line 238 in testAnonymousJobWithDifferentTargetWorkers
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/framework/test_combinations.py", line 343 in execute_test_method
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/framework/test_combinations.py", line 360 in decorated
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/absl_py/absl/testing/parameterized.py", line 314 in bound_param_test
File "/usr/lib/python3.9/unittest/case.py", line 550 in _callTestMethod
File "/usr/lib/python3.9/unittest/case.py", line 592 in run
File "/usr/lib/python3.9/unittest/case.py", line 651 in __call__
File "/usr/lib/python3.9/unittest/suite.py", line 122 in run
File "/usr/lib/python3.9/unittest/suite.py", line 84 in __call__
File "/usr/lib/python3.9/unittest/suite.py", line 122 in run
File "/usr/lib/python3.9/unittest/suite.py", line 84 in __call__
File "/usr/lib/python3.9/unittest/runner.py", line 184 in run
File "/usr/lib/python3.9/unittest/main.py", line 271 in runTests
File "/usr/lib/python3.9/unittest/main.py", line 101 in __init__
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/absl_py/absl/testing/absltest.py", line 2537 in _run_and_get_tests_result
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/absl_py/absl/testing/absltest.py", line 2568 in run_tests
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/absl_py/absl/testing/absltest.py", line 2156 in _run_in_app
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/absl_py/absl/testing/absltest.py", line 2049 in main
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/platform/googletest.py", line 51 in g_main
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/absl_py/absl/app.py", line 258 in _run_main
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/absl_py/absl/app.py", line 312 in run
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/platform/googletest.py", line 60 in main_wrapper
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/platform/benchmark.py", line 489 in benchmarks_main
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/platform/googletest.py", line 62 in main
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/platform/test.py", line 56 in main
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/eager/test.py", line 25 in main
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/distribute/multi_process_lib.py", line 167 in test_main
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/data/experimental/kernel_tests/service/multi_process_cluster.py", line 165 in test_main
File "/root/.cache/bazel/_bazel_root/fbac33eb30dbfb6b11b15a7ff5ac830d/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.runfiles/org_tensorflow/tensorflow/python/data/experimental/kernel_tests/service/local_workers_test.py", line 441 in <module>
```
</details>
majik
28 February 2024 23:02
3
‘nope’ to both questions
tensorflow was the only reasonable reference i found to that port, but it’s not installed
1 Like
Did you search the grand o’l internet?
41615/udp - sx.nix.dk
When an application opens an outgoing connection it will use an available local port and address a named remote port.
There may not be any owner - such as those defined in /etc/services (IANA) - for as long as there is no active services for a any owned port - applications may choose to use the port or port range for their own purpose.
If you really want to know what may use the port I suggest you add the -c/–continous argument to keep watching …
Hi @majik ,
I don’t know if it’s installed by default, or how to install it if not, but you could try netstat
:
netstat -ltnp | grep -w ':41615'
Where:
netstat - Print network connections, routing tables, interface statis‐
=======================================================================
--numeric,-n
Show numerical addresses instead of trying to determine symbolic host,
port or user names.
-p, --program
Show the PID and name of the program to which each socket belongs. A
hyphen is shown if the socket belongs to the kernel (e.g. a kernel ser‐
vice, or the process has exited but the socket hasn't finished closing
yet).
-l, --listening
Show only listening sockets. (These are omitted by default.)
grep - print lines that match patterns
======================================
-w, --word-regexp
Select only those lines containing matches that form whole
words. The test is that the matching substring must either be
at the beginning of the line, or preceded by a non-word
constituent character. Similarly, it must be either at the end
of the line or followed by a non-word constituent character.
Word-constituent characters are letters, digits, and the
underscore. This option has no effect if -x is also specified.
Hope this helps!
cscs
29 February 2024 07:41
6
…The OP example is netstat…
Yeah. Just noticed.
Then he doesn’t have to install it.
Here there’s an example about finding a port with - in netstat, may be you can identify yours the same way:
https://serverfault.com/a/847910
6x12
29 February 2024 10:10
9
I think it’s also used by Brothers in Arms and Splinter Cell games servers. Port 41615 (tcp/udp) :: SpeedGuide .
majik
29 February 2024 12:09
10
don’t laugh - i was reading your post and i thought maybe i should do that
in my defense, i haven’t had my yet
majik
29 February 2024 12:36
12
$ sudo netstat -ltpnae | awk 'NR==2 || /:<port>/'
is empty in my case
i’m starting to wonder if the port isn’t opened by Thunderbird (IMAP) even though it remains after exiting T-bird???
If I remember correctly, you’ll will only get a result if the offending port is actively being listened on…so whatever uses it needs to be open…
Edit:
I just tested. You’ll pretty much get the same result with whichever one you use:
$ sudo netstat -ltpnae | grep ':22'
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 0 24205 724/sshd: /usr/bin/
tcp 0 0 10.0.0.20:34956 10.0.0.254:22 ESTABLISHED 0 7677066 768914/ssh
tcp 0 0 10.0.0.20:39212 193.150.22.84:22067 ESTABLISHED 1000 7723270 859/syncthing
tcp6 0 0 :::22 :::* LISTEN 0 24207 724/sshd: /usr/bin/
tcp6 0 0 :::22000 :::* LISTEN 1000 15142 859/syncthing
tcp6 0 0 10.0.0.20:22000 10.0.0.254:22000 ESTABLISHED 1000 7708234 859/syncthing
tcp6 0 0 10.0.0.20:22000 10.0.0.100:22000 ESTABLISHED 1000 7701489 859/syncthing
Or the more complicated:
$ sudo netstat -ltpnae | awk 'NR==2 || /:22/'
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 0 24205 724/sshd: /usr/bin/
tcp 0 0 10.0.0.20:34956 10.0.0.254:22 ESTABLISHED 0 7677066 768914/ssh
tcp 0 0 10.0.0.20:39212 193.150.22.84:22067 ESTABLISHED 1000 7723270 859/syncthing
tcp6 0 0 :::22 :::* LISTEN 0 24207 724/sshd: /usr/bin/
tcp6 0 0 :::22000 :::* LISTEN 1000 15142 859/syncthing
tcp6 0 0 10.0.0.20:22000 10.0.0.254:22000 ESTABLISHED 1000 7708234 859/syncthing
tcp6 0 0 10.0.0.20:22000 10.0.0.100:22000 ESTABLISHED 1000 7701489 859/syncthing
The only difference is that the one that uses grep
instead of awk
gives the header as well:
$ diff <(sudo netstat -ltpnae | grep ':22') <(sudo netstat -ltpnae | awk 'NR==2 || /:22/') 1 ↵
0a1
> Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
Which might or might not be useful.