Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-19-2013, 04:50 AM   #1
LQ Newbie
Registered: Apr 2013
Posts: 1

Rep: Reputation: Disabled
bash history lost across sessions


I'm using windows with cygwin.
My bash history in cygwin is lost between two consecutive shells.

Here are the outputs of some commands that might help to understand the issue:

set -o | grep history
history on

$ grep -i history ~/.bash_profile ~/etc/bash.bashrc ~/etc/profile ~/.profile
grep: /cygdrive/c/cygwin/home/car/etc/profile: No such file or directory
/cygdrive/c/cygwin/home/car/.profile:if [ "x$HISTFILE" == "x/.bash_history" ]; then
/cygdrive/c/cygwin/home/car/.profile: HISTFILE=$HOME/.bash_history

$ ls -la ~/ | grep history -> no output

$ echo $HISTFILE
$ echo $HISTSIZE

grep -i hist .bashrc
# Make bash append rather than overwrite the history on disk
shopt -s histappend
# History Options
# Don't put duplicate lines in the history.
export HISTCONTROL="ignoredups"
# (added) A new shell gets the history lines from all previous shells
PROMPT_COMMAND='history -a'
# HISTIGNORE is a colon-delimited list of patterns which should be excluded.

What could I try to fix this issue ?

Old 04-19-2013, 07:01 AM   #2
Registered: Feb 2013
Posts: 74

Rep: Reputation: Disabled
do you loose all terminal history or only some of the history ? because the history of the last terminal being closed is going to save in history file not all the terminals.
Old 04-19-2013, 11:07 AM   #3
LQ Veteran
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
The Definitive Guide to Bash Command Line History may shed some light. Around the "Modifying History Behavior" entry...perhaps.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash history delete command from bash itself ashishag Linux - Software 6 05-02-2010 04:39 AM
colored bash sessions, each its own history Linux von Scratchen Linux - Software 2 07-13-2009 11:22 AM
Retaining Bash history from all sessions humbletech99 Programming 4 11-29-2007 06:38 PM
LXer: Keeping Command History across Multiple Sessions LXer Syndicated Linux News 1 11-07-2007 11:58 AM
Lost sessions : textmode,KDE... chlorantus Fedora - Installation 0 12-18-2005 10:29 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:34 PM.

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