Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have some commands replaced with * in the bash history, e.g.

1094  apt-get update
1095* 
1096  dpkg -i /var/cache/apt/archives/libssl1.0.0_1.0.0h-1_amd64.deb

How to prevent this?

share|improve this question

2 Answers 2

Looks like mark-modified-lines is enabled in your shell. Try disabling it in ~/.inputrc:

set mark-modified-lines Off

Details in man bash.

share|improve this answer
3  
weird, bind -V | grep mark-modified-lines tells me it's set to off –  eugene y Apr 11 '12 at 12:03

1) Put set revert-all-at-newline on in your ~/.inputrc
2) Reread initfile (C-x C-r in Emacs-mode)
3) Type history

help history says:

Display the history list with line numbers, prefixing each modified
entry with a `*'.

LESS=+/revert-all-at-newline man bash says:

revert-all-at-newline (Off)
          If set to On, readline will undo all changes  to  history  lines
          before returning when accept-line is executed.  By default, his-
          tory lines may be modified  and  retain  individual  undo  lists
          across calls to readline.

Note:
revert-all-at-newline works fine since bash-4.3.30. Changes:

Fixed a bug that caused effects made by undoing changes to a history line to
be discarded.

Bonus:
mark-modified-lines is unrelated to a history output.

mark-modified-lines
    If  set  to  On,  history lines that have been modified
    are displayed with a preceding asterisk (*).

What does it mean?
1) Add set mark-modified-lines on to ~/.inputrc
2) Reread initfile (C-x C-r in Emacs-mode)
3) Type echo a<ENTER>
4) Type <UP>-arrow key
5) Press Z (you should see *<PS1> echo aZ)
6) Press C-_ (you shouldn't see *)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.