bashunix

How can I concatenate the output of two commands?


How can I concatenate the output of pwd and ls and add it to a file called f1? This is not working:

pwd, ls > f1

Solution

  • Use a compound command:

    { pwd; ls; } > f1