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 ifconfig to a file called debug.txt. So in the terminal I have to type ifconfig > debug.txt . This will save the output to debug.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 : ifconfig > /home/username/Desktop/debug.txt