Redirect all command output, stdin/stderr, to a file on Linux

puppet agent --test --noop >/var/tmp/puppet_noop_20130315 2>&1

  1. The 2>&1 redirects stderr to where stdin points
    1. stdin points to the console by default unless you change that
    2. here stdin is redirected to a file under /var/tmp


Popular posts from this blog

Debugging pfsense firewall rules clearly and easily

Direct ssh to a server via proxy using putty/plink on Windows

telnet vs netcat