commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Allow to launch nc like a daemon, in background until you still stop it.
You can stop it with kill %1 (jobs method) or kill PID.
The -k option can force nc to listen another connection, but if you use redirection, it will work only one time.
The loop's inside doesn't do anything, but we can imagine to send a message to screen when a connection is established
There are 3 alternatives - vote for the best!
If you can do better, submit your command here.
You must be signed in to comment.