To redirect only the standard output (stdout) to a file while keeping the standard error (stderr) unchanged, you can use the following syntax:
command > output.txt
In this command:
commandis the command you want to run.>is the redirection operator.output.txtis the file where you want to redirect the standard output.
This will redirect only the stdout of command to output.txt, while any error messages (stderr) will still be displayed in the terminal.
If you want to append the output instead of overwriting the file, you can use >>:
command >> output.txt
