Mailing List Archive

Command History
Hi

How can I Delete all History commands typed in the Console ?

Thanks

IcEonFirE


--
gentoo-user@gentoo.org mailing list
Re: Command History [ In reply to ]
* Chiheb Djabri (2004-10-08 19:50 +0200)
> How can I Delete all History commands typed in the Console ?

Delete the history file.

> Thanks
>
> IcEonFirE

ThOrsTeN


--
gentoo-user@gentoo.org mailing list
Re: Command History [ In reply to ]
Thorsten Kampe wrote, On 09.10.2004 00:31:
> * Chiheb Djabri (2004-10-08 19:50 +0200)
>
>>How can I Delete all History commands typed in the Console ?
>
>
> Delete the history file.
>
>
>>Thanks
>>
>>IcEonFirE
>
>
> ThOrsTeN

# history -c
# history -w

http://doc.ddart.net/shell/bash/html_node/bashref_73.html

bye Thilo


--
gentoo-user@gentoo.org mailing list
Re: Command History [ In reply to ]
* Thilo Six (2004-10-09 01:36 +0200)
> Thorsten Kampe wrote, On 09.10.2004 00:31:
>> * Chiheb Djabri (2004-10-08 19:50 +0200)
>>>How can I Delete all History commands typed in the Console ?
>>
>> Delete the history file.
>>
>>
>>>Thanks
>>>
>>>IcEonFirE
>>
>> ThOrsTeN
>
> # history -c
> # history -w

thorsten@galactus% history -c
zsh: bad option: -c
thorsten@galactus% history -w
zsh: bad option: -w
thorsten@galactus%


--
gentoo-user@gentoo.org mailing list
Re: Command History [ In reply to ]
Thorsten Kampe wrote, On 09.10.2004 15:27:

>>
>># history -c
>># history -w
>
>
> thorsten@galactus% history -c
> zsh: bad option: -c
> thorsten@galactus% history -w
> zsh: bad option: -w
> thorsten@galactus%


http://doc.ddart.net/shell/bash/html_node/bashref_73.html
^^ ^^

I guess one more reason to switch to the right Shell. hehe ;P


bye Thilo


--
gentoo-user@gentoo.org mailing list
Re: Command History [ In reply to ]
* Thilo Six (2004-10-09 17:10 +0200)
> Thorsten Kampe wrote, On 09.10.2004 15:27:
>>># history -c
>>># history -w
>>
>> thorsten@galactus% history -c
>> zsh: bad option: -c
>> thorsten@galactus% history -w
>> zsh: bad option: -w
>> thorsten@galactus%
>
> http://doc.ddart.net/shell/bash/html_node/bashref_73.html
> ^^ ^^

Neither you or me know wich shell the original poster was running.
It's very likely that he doesn't even know it himself.

> I guess one more reason to switch to the right Shell. hehe ;P

Exactly:

thorsten@galactus% zsh -c "autoload -U allopt; allopt | wc -l"
142
thorsten@galactus% bash -lc "(shopt; set -o; bind -v) | wc -l"
86

Thorsten


--
gentoo-user@gentoo.org mailing list
Re: Command History [ In reply to ]
Thorsten Kampe wrote, On 09.10.2004 20:21:

> Neither you or me know wich shell the original poster was running.
> It's very likely that he doesn't even know it himself.

If it´s the default, then it´s bash.
When not, he´s smart enough to manage it by himself.


>>I guess one more reason to switch to the right Shell. hehe ;P
>
>
> Exactly:
>
> thorsten@galactus% zsh -c "autoload -U allopt; allopt | wc -l"
> 142
> thorsten@galactus% bash -lc "(shopt; set -o; bind -v) | wc -l"
> 86
>
> Thorsten


So many Options and they are not able to delete the history from
inside.

hmmm

bye Thilo


--
gentoo-user@gentoo.org mailing list
Re: Command History [ In reply to ]
* Thilo Six (2004-10-09 23:01 +0200)
> Thorsten Kampe wrote, On 09.10.2004 20:21:
>> Neither you or me know wich shell the original poster was running.
>> It's very likely that he doesn't even know it himself.
>
> If it´s the default, then it´s bash.
> When not, he´s smart enough to manage it by himself.

"Interesting" logic. As convincing as "if he's smart enough to install
Gentoo, he's smart enough to manage it himself". Oh no, wait, you mean
"if he's dumb enough to ask such a question, he's surely using bash".
Well, that makes sense - in a weird way.

By the way, do you think /you/ are smart enough to "manage" the
difference between an apostrophe and an accent?!

>>>I guess one more reason to switch to the right Shell. hehe ;P
>>
>> Exactly:
>>
>> thorsten@galactus% zsh -c "autoload -U allopt; allopt | wc -l"
>> 142
>> thorsten@galactus% bash -lc "(shopt; set -o; bind -v) | wc -l"
>> 86
>>
>> Thorsten
>
> So many Options and they are not able to delete the history from
> inside.

Wrong logic again: zsh doesn't use a history file by default (like
bash). So if you yourself set your history file, why should you delete
it?! If you don't want a certain line written to history, you just
prepend a leading blank (this is an option of course). The whole
question only makes sense for bash.

By the way (II): your "history -c; history -w" doesn't empty the
history file. The only way to /really/ delete "all History commands
typed" is "rm $HISTFILE; unset $HISTFILE". And this is correct for
bash /and/ zsh.

Thorsten


--
gentoo-user@gentoo.org mailing list
Re: Command History [ In reply to ]
Thorsten Kampe wrote, On 10.10.2004 13:33:


> By the way (II): your "history -c; history -w" doesn't empty the
> history file.

You tested it, did you? I did and works, with bash.
Of course when you log out of an other shell then _it_
will rewrite those history.


> Thorsten

Oh come on guy. It started as joke.
Why can´t you treat it like that?

If you feel better, I apologise to you.
Realy I don´t want to argue with and definitely against you. OK?

Have a nice day.


bye Thilo


--
gentoo-user@gentoo.org mailing list
Re: Re: Command History [ In reply to ]
* On Sat Oct-09-2004 at 11:01:06 PM +0200, Thilo Six said:
>
> So many Options and they are not able to delete the history from
> inside.

May not be builtins, but these 2 work from my shell:

% rm ~/.zhistory

% cat /dev/null > ~/.zhistory

:)

--
Sami Samhuri
Re: Command History [ In reply to ]
Sami Samhuri wrote, On 10.10.2004 21:11:
> * On Sat Oct-09-2004 at 11:01:06 PM +0200, Thilo Six said:
>
>>So many Options and they are not able to delete the history from
>>inside.
>
>
> May not be builtins, but these 2 work from my shell:
>
> % rm ~/.zhistory
>
> % cat /dev/null > ~/.zhistory
>
> :)
>

Sami Samhuri 1:0 ;)


--
gentoo-user@gentoo.org mailing list
Re: Command History [ In reply to ]
Sami Samhuri wrote, On 10.10.2004 21:11:
> * On Sat Oct-09-2004 at 11:01:06 PM +0200, Thilo Six said:
>
>>So many Options and they are not able to delete the history from
>>inside.
>
>
> May not be builtins, but these 2 work from my shell:
>
> % rm ~/.zhistory
>
> % cat /dev/null > ~/.zhistory
>
> :)
>

Just one Info that I learned today:

You also can do:

> ~/.zhistory

(it works here, should work with zsh also, I think)


I´ve set "set -o noclobber" in .bashrc so for me it is:

>| ~/.zhistory


Have fun ;)

bye Thilo


--
gentoo-user@gentoo.org mailing list
Re: Re: Command History [ In reply to ]
* On Sun Oct-10-2004 at 11:02:47 PM +0200, Thilo Six said:
[...]
> I?ve set "set -o noclobber" in .bashrc so for me it is:
>
> >| ~/.zhistory

I've been using bash a bit more recently too. They are both good shells.

--
Sami Samhuri