Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 3
    What stops you from using echo source-server.fqdn >file.txt before running your nc command? Commented Feb 14, 2024 at 9:50
  • 2
    Does this answer your question? How can I save the command and its execution output to file at the same time Commented Feb 14, 2024 at 9:58
  • @Kusalananda Or something like { echo source-server.fqdn; nc -zv -s ...; } >>file.txt Commented Feb 14, 2024 at 10:57