Problems with the history

Forum rules
Before you post please read this

Problems with the history

Postby aalemann on Thu Jan 24, 2013 2:29 pm

Hi,

I find the history in the bash quite useful and I wanted to increase its size. Therefore I create a .bashrc file in my home directory (there was no such file in it before), wrote the appropriate commands into it and it worked.
However, when I set the option "erasedups" which should prevent me from getting duplicate entries in my history file, this is not working, "ignoredups" works though.

What am I doing wrong?

Here is my .bashrc:
Code: Select all
echo "   DON'T PANIC   "

alias ll="ls -l"
alias la="ls -a"

# set behaviour of the history
export HISTCONTROL=ignoredups:erasedups
export HISTSIZE=100000
export HISTFILESIZE=100000
shopt -s histappend
PROMPT_COMMAND="history -a"


Yes, I logged out and in after editing/creating my .bashrc.

Thanks,
aalemann
Last edited by xenopeek on Thu Jan 24, 2013 2:37 pm, edited 1 time in total.
Reason: Moved to Bash section.
Linux Mint 15 Olivia
Linux 3.8.0-19-generic x86_64
Intel(R) Core(TM) i3-2100
aalemann
Level 1
Level 1
 
Posts: 19
Joined: Wed Nov 28, 2012 5:57 am

Linux Mint is funded by ads and donations.
 

Re: Problems with the history

Postby Habitual on Thu Aug 01, 2013 5:55 pm

I've had
Code: Select all
HISTCONTROL=ignoredups:erasedups:ll
in my .bashrc for years,
What I have noticed is that it only ignores 2 identical commands in a row,

YMMV :)

Hope that helps.
What's a landing but a take off in reverse?
My DorkBlog
User avatar
Habitual
Level 8
Level 8
 
Posts: 2066
Joined: Sun Nov 21, 2010 8:31 pm
Location: Undecided


Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 3 guests

cron