Have you ever wondered how to copy the output of your terminal into a text file? Or maybe you teach Linux and you want to see what your students typed in and as well as the output? You think that running history is not enough? Then you need the script command.

Running script command

Open the man page of script command and you will see this:

Script makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out later with lpr(1).

In a nutshell, it is history and tee all rolled into one. It will record everything you see on your screen, even the color. So if you typed in an invalid command, you will see the error in the log or if you run it correctly, you will have the output. But commands like top that refreshes the screen at an interval will most likely ruin the session or the log, so try to avoid similar commands.

To use it, just type the command script and it will begin recording the session. Once you are done, just type exit.

The above scenario will perform the following:
1) On the Student’s terminal, it will create an named pipe /tmp/script_test.fifo (man mkfifo) then run the script command with the -f option that ‘flushes’ out the output after each run. The Student’s terminal will look like it is not responding at this point, but don’t worry, it is perfectly normal.
2) On the Teacher’s terminal, the command cat will read the output file. Once you run the cat command, the session will be started.

Try the above steps and see how each screen behaves. Check also if doing the script command will create a populated output file.

Please, everyone settle down. I am not starting a flame thread here but I would like you to read these ten reasons why Linux will stomp over Windows’s head. TechRepublic writes:

I have an announcement. The error of Microsoft’s ways is finally catching up and will cause the once-invincible juggernaut to kneel before that which is Linux. How is this? Microsoft started a tiny snowball when it released Windows Me. That snowball did nothing but gain momentum. There have been ups and downs along the way (XP being an up, for sure). But for the most part, the court of public opinion has steady lost faith in what once was considered the heart of personal computing.

If you don’t believe me, read on.

1. Inconsistent Windows releases

One of the things you can always count on from Microsoft is that you can’t count on its new operating systems to be reliable. Let’s take a look at the individual releases:

* Windows 95: Revolutionized personal computing.
* Windows 98: Attempted to improve on Windows 95; failed miserably.
* Windows Me: A joke, plain and simple.
* Windows NT: Attempted to bring enterprise-level seriousness to the operating system; would have succeeded had it not taken Steven Hawking-like intelligence to get it working.
* Windows XP: Brought life back to the failing Windows operating system. It hadn’t been since Windows 95 that the operating system was this simple.
* Windows Vista: See Windows Me.

With this in mind, what do we expect from Windows 7? Myself, not much.

2. Consistent Linux releases

Converse to number 1, you have the far more consistent releases of the various Linux distributions. Yes, there have been a few dips along the way (Fedora 9 being one of them). But for the most part, the climb for Linux has been steadily upward. Nearly every Linux distribution has improved with age. And this improvement isn’t limited to the kernel. Look at how desktops, end-user software, servers, security, admin tools, etc., have all improved over time. Once could easily argue that KDE 4 is an example of a sharp decrease in improvement. However, if you look at how quickly KDE 4 has improved from 4.0 to 4.3 you can see nothing but gains. This holds true with applications and systems across the board with Linux.

Windows 7 is getting quite a lot of stirs nowadays. But I am a bit skeptical how Windows 7 is going to be any different from its predecessor Windows Vista. What I want to know is its security features and features that are usable for IT administrators. Actually, when it comes to Windows, I am still biased on its security features. My rule of the thumb for Windows OS’es is “wait for SP2 before buying and installing”. I am still using Windows XP in my computer at home but my Ubuntu still kicks XP’s butt, IMO. But that’s just me.