open a port permanently on linux using nc (netcat) [duplicate]

nc is the wrong tool for this job (to a greater or lesser degree based on which version you have; the more appropriate ones have the option to fork a subprocess for each new incoming connection). Use a proper built-to-purpose superserver — xinetd was the up-and-coming standard 25 years ago; today I’d suggest tcpsvd. (In some cases a systemd socket unit is appropriate, but I’m not sure you’re …

https://stackoverflow.com/questions/76323691/open-a-port-permanently-on-linux-using-nc-netcat