How can I concatenate the output of pwd and ls and add it to a file called f1? This is not working:
pwd
ls
pwd, ls > f1
Use a compound command:
{ pwd; ls; } > f1