 <p><code>nginx</code> must be writing that message to standard error, not standard output. If you want to pipe it, you have to redirect stderr to stdout:</p> <pre><code>nginx -v 2&gt;&amp;1 | awk -F/ '{print $2}' </code></pre>