Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot redirect command output to a file (for postfix status)

Tags:

linux

bash

shell

I am trying to run the following command:

postfix status > tmp

however the resulting file never has any content written, and instead the output is still sent to the terminal.

I have tried adding the following into the mix, and even piping to echo before redirecting the output, but nothing seems ot have any effect

postfix status 2>&1 > tmp

Other commands work no problem.

like image 832
Chris Avatar asked Feb 18 '26 05:02

Chris


1 Answers

script -c 'postfix status' -q tmp
like image 112
Julian Avatar answered Feb 20 '26 20:02

Julian