LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-24-2011, 02:50 AM   #1
schuurs
Member
 
Registered: Feb 2010
Location: The Netherlands
Distribution: CENTOS6.2 / RHEL5.11 / RHEL 7.4
Posts: 40

Rep: Reputation: Disabled
terminal history


Hello,

When using the command line every terminal has its own history. Well, that is what I noticed under RHEL3, Fedora 8 and Mint 9.

With RHEL5, I noticed that there is no history per terminal, but one big history across terminal. This means that when I use two terminals or when I do an ssh to a different machine, all the history is saved chronologically.
When I want to use a previous command in a certain terminal, I have to go through all commands including those of an other terminal and stopped terminals to find the one I need.

In the past I only had to go through the history of that particular terminal.

Is there a way to restore this so that I only have to walk through the history of one terminal instead of all?

I am using RHEL5, GNOME and ksh.

Thank you
 
Old 01-24-2011, 11:03 AM   #2
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
I think the behaviour you are seeing is due to your use of ksh. I've never used ksh but apparently it shares history between all running instances for that user. bash does not do this. I suspect that when you say you didn't see the behaviour in RHEL3 Fedora and Mint it's because you were using bash not ksh.

So I'd suggest either using bash instead of ksh or setting up ksh to use separate history files.
http://kornshell.com/doc/faq.html
http://unix.stackexchange.com/questi...-for-same-user

Last edited by arizonagroovejet; 01-24-2011 at 11:03 AM. Reason: eroneous extra words removed
 
1 members found this post helpful.
Old 01-25-2011, 05:29 AM   #3
schuurs
Member
 
Registered: Feb 2010
Location: The Netherlands
Distribution: CENTOS6.2 / RHEL5.11 / RHEL 7.4
Posts: 40

Original Poster
Rep: Reputation: Disabled
Dear arizonagroovejet,

Thank you for the link to the kornshell faq.

With the help of this faq, I created a line in the .kshrc file that sets the history file.

Code:
export HISTFILE="~/.history_${RANDOM}.txt
The created files are removed at logon.
This will keep everything clean.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How can I view history logs of terminal usage? chinho Linux - Server 3 12-23-2010 10:49 AM
Slow terminal history browse using vesafb maxkukartsev Slackware 1 08-18-2010 05:02 PM
Browsing Terminal History mijohnst Solaris / OpenSolaris 4 01-24-2007 10:56 PM
Terminal Command History? Allen614 Linux - General 3 01-14-2003 11:35 PM
terminal history logging alue Linux - General 4 03-15-2002 01:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration