Answers for "linux output to terminal and file"

0

linux output to terminal and file

Yes it is possible, just redirect the output (AKA stdout) to a file:

SomeCommand > SomeFile.txt  
Or if you want to append data:

SomeCommand >> SomeFile.txt
If you want stderr as well use this:

SomeCommand &> SomeFile.txt  
or this to append:

SomeCommand &>> SomeFile.txt  
if you want to have both stderr and output displayed on the console and in a file use this:

SomeCommand 2>&1 | tee SomeFile.txt
(If you want the output only, drop the 2 above)
Posted by: Guest on August-26-2021
0

linux terminal write output to file

SomeCommand > SomeFile.txt
Posted by: Guest on April-27-2021

Code answers related to "linux output to terminal and file"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language