There are times when you need to post the outcome of a particular command(s) from a shell on a forum or somewhere else. It might be for troubleshooting or demonstration. However, copy-paste is not exactly a good option if your shell is filled with tons of information. Not to mention, you would spend a lot of time just selecting the text & then pasting it into a word processor. Wouldn’t life be easy if there would be a script which would gather all the data from a terminal & save it to a file? It does exist.
Before starting to run the command(s) whose output you wish to capture, enter;
$script -a filename
You will get,
[shuttertux@localhost ~]$ script -a filename
Script started, file is filename
Now one can begin entering the required commands. Once done, type;
[shuttertux@localhost ~]$ exit
Script done, file is filename
Now you can view the output file simply by,
Wasn’t that easy? Just remember, the output file is saved in your present working directory.
Screenshots are vital when reviewing an application or giving visual assistance to those problems whose solution is difficult to jot down in words. For starters, when you press the ‘Prt Scr’ i.e. ‘Print Screen’ keyboard button the computer will automatically print what is currently being displayed on the screen & prompt you to save it as a file. The Screenshot application found under GNOME provides further options to finetune screenshot capturing as per your needs. While this will work fine when you’re running under a GUI but what would you do if you want to take screenshot when you are in a shell(virtual console) or when your GUI is broken? The print screen button on your keyboard won’t work in at the command prompt. In such a case you’ll need to use the following command.
$ import -window root /home/ShutterTux/Pictures/screenshot.png
The above command will save the screenshot of the current screen without any delay into the ‘Pictures” directory of user ‘LaymanLinux’ with the file name as ‘screenshot.png’. The file saving location need not be necessarily pictures directory & you can give any location in your home directory. Do remember to change the name of the output screenshot file to avoid conflicts.
You can even issue the command with a delay;
$ delay 20; import -window root /home/ShutterTux/Pictures/screenshot2.png
The above command will take screenshot after 20 seconds and save it to the location entered by the user.
For further application of the import command, you can refer this page.
Most of the modern Linux distros can easily detect & mount external drives automatically. In extremely rare case they may fail to mount. At such times, knowing how to manually mount the external drives will come handy. This simple guide will show you to mount external drives like pendrive, external hard-disks, card reader etc in Linux.
By now, you might have started reading more about Linux. Whatever guide or article you read; I bet most if not all had commands at some point or the other. Being a novice, it is expected that you didn’t get head or tail of the commands. Now you ask, Does knowing commands is so essential to learn Linux. To give a quick answer – Yes & No!