8.2.1 Recording shell activities
System administration involves much more elaborate tasks in a Unix environment
than in an ordinary personal computer environment. Make sure to know the most
basic means of configuration in case you need to recover from system trouble.
X11-based GUI configuration tools look nice and convenient but are often
unsuitable in these emergency situations.
In this context, recording shell activities is a good practice, especially as
root.
Emacs: Use M-x shell to start recording into a buffer, and use C-x
C-w to write the buffer to a file.
Shell: Use the screen
command with "^A H" as described
in
Console switching with screen
, Section
8.6.28; or use the script
command.
$ script
Script started, file is typescript
... do whatever ...
Ctrl-D
$ col -bx <typescript >savefile
$ vi savefile
The following can be used instead of script
:
$ bash -i 2>&1 | tee typescript