Showing posts with label script. Show all posts
Showing posts with label script. Show all posts

Sunday, April 19, 2009

How to see what others are doing in real time ?

There are some situation when you are only interested in knowing what others are doing.
Let say two guys are trying to fix a server and as a supervisor, you are interested in knowing how they are doing in real time.

You may do this using script command. Let say person is logged in and his terminal type is pts/0. Running "w" tells this.

script -f /dev/pts/0


This tool is good for learning from team member's skill.

Why dont you save your command and its output ?

Lets say you are working on a known issue and you need to document the commands and their result.
You may use script command to capture various commands and its output.

How to use script

$script FILE-NAME

This command will open new shell. Now what ever command you issue,along with its output will be logged into FILE-NAME. Once you are done,press "CTRL-D" and you are out of screen command.

Although this command is very simple but it helps to document things.