I simply want to append the outputs of two command which are ps -A and du into a file called "info"
This is what I've got:
ps -A ; du > info
However, it only adds du into the file. What am I getting wrong?
-
Related: Pipe/redirect a group of commandssteeldriver– steeldriver2020年06月12日 11:59:11 +00:00Commented Jun 12, 2020 at 11:59
1 Answer 1
No need to use a subshell (another process) :
{ ps -A ; du; } > info
# ^
# |
# mandatory (in this one liner case)
or
{
ps -A
du
} > info
answered Jun 12, 2020 at 12:23