nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

How to save history of a hung terminal

This is a discussion on How to save history of a hung terminal within the Linux software forums, part of the Linux Getting Started category; Hi all, I am a bit confused. Some of the Engineers in my org and I need to login to ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 06-19-2006, 11:35 PM
Member
User
 
Join Date: Jul 2005
Posts: 85
Rep Power: 0
ricc
Default How to save history of a hung terminal

Hi all,
I am a bit confused. Some of the Engineers in my org and I need to login to a remote site to keep log and diagnose any problems. We use ssh to do this.

What I have observed is that if someone logs in and loses the connection in between( i.e before he logs out), we have a hung session. And if we kill the process upon login again, the command history of that hung session is lost.

I am not sure, but I think that when we kill the hung session, it doesn't write back to the .bash_history. Is there a way that we can save the command history of this hung session?. Or am I wrong altogether. Does it save the command history even when we kill the hung session.

I hope you all have understood what I am saying. .

ricc
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-20-2006, 01:16 AM
tom tom is offline
Contributors
User
 
Join Date: Jun 2005
Location: London, UK
Posts: 213
Rep Power: 4
tom is on a distinguished road
Default

Put script command in ~/.bash_profile it will write session to file called typescript. Read man page of script for more information.
Reply With Quote
  #3 (permalink)  
Old 06-20-2006, 01:21 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,061
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default Force bash history command to write the history file

By default history isn't written to the file called .bash_history until you logout. To force the write use following command:
Code:
history -w
Setup a cron job for history -w that will write out history every 1 minute or according to your setup.
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
how to open an pdf file(.pdf) in terminal chandrasekar Getting started tutorials 1 03-27-2008 01:41 AM
Installation hung up at 85% alleykat Getting started tutorials 1 11-01-2007 10:51 AM
wget url marked 'save target-as' sasuhaib The Hangout 0 09-14-2007 12:17 PM
How can I take a screenshot from an X TERMINAL? sweta Shell scripting 4 07-20-2006 08:51 PM
Command history ricc Linux software 1 04-26-2006 05:57 PM


All times are GMT +5.5. The time now is 03:10 AM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36