Skip to main content
deleted 76 characters in body
Source Link
Vombat
  • 13.3k
  • 14
  • 47
  • 58

Change your command to this:

nc -zv 192.168.1.1 1-100 2>&1 | grep succeeded

2>&1 causes stderr output of a program to be written to the same file descriptor as stdout. The messages on the terminal are actually mix of error and normal outputs. Without redirecting nc writes to stderr by default, pipe will only get stdout hence grep will miss somethe data.

See section 3.5 here for more info All about redirection.

Change your command to this:

nc -zv 192.168.1.1 1-100 2>&1 | grep succeeded

2>&1 causes stderr output of a program to be written to the same file descriptor as stdout. The messages on the terminal are actually mix of error and normal outputs. Without redirecting stderr, pipe will only get stdout hence grep will miss some data.

See section 3.5 here for more info All about redirection.

Change your command to this:

nc -zv 192.168.1.1 1-100 2>&1 | grep succeeded

2>&1 causes stderr of a program to be written to the same file descriptor as stdout. nc writes to stderr by default, pipe will only get stdout hence grep will miss the data.

See section 3.5 here for more info All about redirection.

added 390 characters in body
Source Link
Vombat
  • 13.3k
  • 14
  • 47
  • 58

Change your command to this:

nc -zv 192.168.1.1 1-100 2>&1 | grep succeeded

2>&1 causes stderr output of a program to be written to the same file descriptor as stdout. The messages on the terminal are actually mix of error and normal outputs. Without redirecting stderr, pipe will only get stdout hence grep will miss some data.

See section 3.5 here for more info All about redirection.

Change your command to this:

nc -zv 192.168.1.1 1-100 2>&1 | grep succeeded

Change your command to this:

nc -zv 192.168.1.1 1-100 2>&1 | grep succeeded

2>&1 causes stderr output of a program to be written to the same file descriptor as stdout. The messages on the terminal are actually mix of error and normal outputs. Without redirecting stderr, pipe will only get stdout hence grep will miss some data.

See section 3.5 here for more info All about redirection.

Source Link
Vombat
  • 13.3k
  • 14
  • 47
  • 58

Change your command to this:

nc -zv 192.168.1.1 1-100 2>&1 | grep succeeded