# Where is the setup that forbids replicate command history?

Allow is claim I type the adhering to series of commands:

$cd$ ls
\$ ls


When I return in background by pushing up two times, I wind up with cd, as opposed to ls.

I've seen this isn't constantly the instance, so it most likely is some bash setup someplace. Which is it?

0
2019-05-18 23:54:19
Source Share

The is regulated by the HISTCONTROL variable. If is has ignoredups, after that replicate commands will certainly not be conserved in the background. Without this string, they will certainly be conserved. This would certainly be generally embeded in .profile or .bashrc, making use of something like

export HISTCONTROL=ignoredups


Other values that can be made use of in HISTCONTROL (multiple can be made use of, divided by :)

• ignorespace any kind of commands beginning with a room are not included in the background
• erasedups replicate commands are gotten rid of from the background, so the background just has the most up to date command
• ignoreboth the same to ignoredups:ignorespace
0
2019-05-21 09:46:11
Source

HISCONTROL=ignoredups

0
2019-05-21 09:41:23
Source