Friday, May 29, 2009

How To Save Output Of A Command Entered In Ubuntu Terminal To A File

Here's a small tip which would help you save the output of a command entered in ubuntu to a file . This can be very useful if you would like to keep a copy of it to a file , or send it to your friend etc.This can be also useful for automation scripts to save outputs as logs.So here's how you do it :

In this example , i would like to save the output of ls to a file called output.txt . So in the terminal i have to type ls > output.txt . This will save the output to output.txt which will be located in your home folder . If you want it to be on your Desktop , then just enter the full location to your desktop , example : ls > /home/prash/Desktop/output.txt

No comments: