The other day, I wanted to learn more about keystore command that I just read about on the forum. So opened a terminal and typed keystore >keystore_help.txt
I got a text file on my desktop which is easier to read than terminal output and also more handy when you want to try something.
Today, as I was wondering about package command, I tried to use the same trick
and typed package >package_help.txt
.
If the file package_help.txt was well created on my desktop, the terminal output wasn’t redirected and as a result the file was empty.
Is it a particularity of this command or a bug that I should report?
Lots of commands output their help information to stderr
instead of stdout
. You have to either redirect stderr
separately, using 2>file.txt
, or redirect stderr
into stdout
, using 2>&1
.
Thanks. I will try that.