Re: history issue - bug?
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.
Reply to: