Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #191064

Re: history issue - bug?

From David Wright <deblis@lionunicorn.co.uk>
Newsgroups linux.debian.user
Subject Re: history issue - bug?
Date 2018-01-14 15:50 +0100
Message-ID <v7RLI-4Dn-3@gated-at.bofh.it> (permalink)
References <v7QcW-3Nq-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun 14 Jan 2018 at 14:07:01 (+0100), Hans wrote:
> Hi folks, 
> 
> try this:
> 
> 1. login as normal user
> 
> 2. become root with "su -"

… which reads ~/.bash_history into what I call the command recall buffer.

> 3. delete history with "history -c"

… which deletes all the entries in the recall buffer, those just read
  in and those commands typed since logging in.

> 4. Check history, history is gone

Presumably you mean you just tried to recall a command and failed.
Make that command "ls -l ~/.bash_history" and you'll see the file
is still there.

> 5. logout from root by "CTL + D" or "exit"
> 
> 6. relogin as root with "su -"

… which reads ~/.bash_history.

> 7. Check history, voila, it appears again.

… as expected.

> What is wrong?

Distinguish between history list and history file.

To eliminate your history, you need to remove/empty the file and
also clear the list just before you logout.

Cheers,
David.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

history issue - bug? Hans <hans.ullrich@loop.de> - 2018-01-14 14:10 +0100
  Re: history issue - bug? David Wright <deblis@lionunicorn.co.uk> - 2018-01-14 15:50 +0100
    Re: history issue - bug? Hans <hans.ullrich@loop.de> - 2018-01-14 17:50 +0100
      Re: history issue - bug? bw <bwtnguy@yahoo.com> - 2018-01-14 18:20 +0100
        Re: history issue - bug? Hans <hans.ullrich@loop.de> - 2018-01-14 18:30 +0100
          Re: history issue - bug? Brian <ad44@cityscape.co.uk> - 2018-01-14 19:50 +0100
        Re: history issue - bug? rhkramer@gmail.com - 2018-01-14 19:10 +0100
          Re: history issue - bug? bw <bwtnguy@yahoo.com> - 2018-01-14 19:40 +0100
          Re: history issue - bug? David Wright <deblis@lionunicorn.co.uk> - 2018-01-14 20:50 +0100
      Re: history issue - bug? David Wright <deblis@lionunicorn.co.uk> - 2018-01-14 20:30 +0100
      Re: history issue - bug? davidson <davidson@freevolt.org> - 2018-01-16 05:40 +0100
  Re: history issue - bug? Felipe Salvador <felipe.salvador@gmail.com> - 2018-01-14 18:30 +0100
    Re: history issue - bug? Felipe Salvador <felipe.salvador@gmail.com> - 2018-01-16 17:50 +0100

csiph-web