1

This is such a simple task I must be overlooking something. I am using rpcclient to dump some data and I cannot seem to figure out how to redirect the output to a file.

The standard > doesn't seem to work when I am in the tool and I do not see anything about saving to an output file in the documentation. Does anyone know how to accomplish this?

Joe
  • 161
  • 1
  • 11

1 Answers1

0

You probably have output going to STDERR. The '>' only redirects STDOUT by default. If you want to capture everything, you can use the & modifier or 2>&1 which redirect STDERR into STDOUT so everything is mashed together

/bin/ls some_non_existant_thing &> /tmp/all_output.log or /bin/ls something_else_non_existant 2>&1>/tmp/all_output_2.log

The reason the two separate streams are used is so typical script output can be logged while STDERR can be monitored for only error messages. It's useful when automating things.

Server Fault
  • 3,714
  • 12
  • 54
  • 89
  • Sorry I should have been more clear in my question. I understand how redirects work and I have tried stderr - Really I want to capture specific output from commands. However, when you activate rpcclient, the cmd prompt changes and I lose the ability to redirect all together. – Joe May 09 '19 at 13:56
  • can you post an example of your command and arguments? – Server Fault May 09 '19 at 14:07