Dear All I have a strange behaviour on my bash shell on F7. In some session, I lose all the histoty!!! I don t find any command that I have executed in my previous sessions. Regards. Adel
Adel ESSAFI wrote:
Dear All I have a strange behaviour on my bash shell on F7. In some session, I lose all the histoty!!! I don t find any command that I have executed in my previous sessions. Regards. Adel
\ls -l ~/.bash_history \lsattr ~/.bash_history
Change ~ to ~whatever as appropriate.
Oh, and just leave "reply to" pointing at the list. I don't like replying off-list.
Hi, Thanks for the response. I am really sorry! But I have a problem with my ISP mail server. :( Regards Adel
John Summerfield a écrit :
Adel ESSAFI wrote:
Dear All I have a strange behaviour on my bash shell on F7. In some session, I lose all the histoty!!! I don t find any command that I have executed in my previous sessions. Regards. Adel
\ls -l ~/.bash_history \lsattr ~/.bash_history
Change ~ to ~whatever as appropriate.
Oh, and just leave "reply to" pointing at the list. I don't like replying off-list.
John Summerfield wrote:
Adel ESSAFI wrote:
Dear All I have a strange behaviour on my bash shell on F7. In some session, I lose all the histoty!!! I don t find any command that I have executed in my previous sessions. Regards. Adel
\ls -l ~/.bash_history \lsattr ~/.bash_history
Change ~ to ~whatever as appropriate.
Oh, and just leave "reply to" pointing at the list. I don't like replying off-list.
I have noticed this for ages. If you have multiple shells open, one will override the others. So some sessions won't be stored in the history. If you are like me, I have multiple shell windows open so I don't rely on history. At home I only keep one line for privacy.
Robin Laing wrote:
John Summerfield wrote:
Adel ESSAFI wrote:
Dear All I have a strange behaviour on my bash shell on F7. In some session, I lose all the histoty!!! I don t find any command that I have executed in my previous sessions. Regards. Adel
\ls -l ~/.bash_history \lsattr ~/.bash_history
Change ~ to ~whatever as appropriate.
Oh, and just leave "reply to" pointing at the list. I don't like replying off-list.
I have noticed this for ages. If you have multiple shells open, one will override the others. So some sessions won't be stored in the history. If you are like me, I have multiple shell windows open so I don't rely on history. At home I only keep one line for privacy.
sudo chatter +a ~/.bash_history
Adel ESSAFI wrote:
Dear All I have a strange behaviour on my bash shell on F7. In some session, I lose all the histoty!!! I don t find any command that I have executed in my previous sessions. Regards. Adel
From my custom /etc/profile:
# reconfigure the history file # prevents multiple logins to the same id from clashing # thought to work for bash and ksh #================================================================ if [ -n "$HISTFILE" ]; then hdir=${HISTFILE%/*} hfile=${HISTFILE##*/} nfile=$(tty); nfile=.sh_hist_${nfile##*/} if [ "$hfile" != "$nfile" ]; then ( cd $hdir && touch $hfile && mv $hfile $nfile ) && HISTFILE=${hdir}/${nfile} fi unset hdir hfile nfile fi
Note, this was written in 1990 or so, when ksh was a very new toy. It has been working untouched for about 15 years, and the only thing changed is that on exit I now shred, purge, or at least delete the file for security. The world is a scarier place now. :-(
Somebody in the thread at some point said:
Note, this was written in 1990 or so, when ksh was a very new toy. It has been working untouched for about 15 years, and the only thing changed is that on exit I now shred, purge, or at least delete the file for security. The world is a scarier place now. :-(
Nice script. Have a look at these guys on your box though, if you are using KDE and I think Gnome too.
~/.recently-used.xbel <--- eye opener ~/.recently-used ~/.thumbnails/normal/* ~/.thumbnails/large/*
I found you can set ~/.bash_history to be an empty ro file and inside a session the history still works, for xterm-type things anyway.
-Andy
Andy Green wrote:
Somebody in the thread at some point said:
Note, this was written in 1990 or so, when ksh was a very new toy. It has been working untouched for about 15 years, and the only thing changed is that on exit I now shred, purge, or at least delete the file for security. The world is a scarier place now. :-(
Nice script. Have a look at these guys on your box though, if you are using KDE and I think Gnome too.
~/.recently-used.xbel <--- eye opener ~/.recently-used ~/.thumbnails/normal/* ~/.thumbnails/large/*
Holly crap. That is very interesting. Not something that I really wanted to see.
I found you can set ~/.bash_history to be an empty ro file and inside a session the history still works, for xterm-type things anyway.
-Andy
I guess there are more files to deal with for privacy and security. Time to encrypt some of these by default. RFE time.
Robin Laing wrote:
Adel ESSAFI wrote:
I have a strange behaviour on my bash shell on F7. In some session, I lose all the histoty!!! I don t find any command that I have executed in my previous sessions. Regards. Adel
I have noticed this for ages. If you have multiple shells open, one will override the others. So some sessions won't be stored in the history. If you are like me, I have multiple shell windows open so I don't rely on history. At home I only keep one line for privacy.
Apparently that is not the case.
Bash doesn't write to .bash_history in "real time". It writes the history when the terminal session is closed. So in case of multiple sessions, the history of the session that logs out first is written first and so on.
If the session is killed, maybe by killing the process or if a remote ssh session gets dropped due to network problems, the history doesn't get written. That could be one explanation to the problem noticed by Adel.