Wednesday, July 30, 2008

Linux logging activity

Option 1
Using command "script"
1) script -af `date +%F_%H_%M`
eg file2008-07-28_17_00
2) Run the commands
3) exit

Option 2
Using command "screen"
1) In users homedir create file .screenrc
$cat .screenrc
#enable logging
deflog on
# logfile location
logfile /tmp/screen.`date +%F_%H_%M`
2) screen
3) Run commands
4) To detach " Cltr + a + D" , To Reattach screen -r OR

Uses "more" or cat | less to view files, vi displays color codes and control characters

No comments: