Re: bash history customizing
From: Gabkin (gabriell_at_programmer.net)
Date: 05/28/04
- Next message: bill: "Re: Unix without shell"
- Previous message: Sven Mascheck: "Re: Unix without shell"
- In reply to: Thorsten Kampe: "Re: bash history customizing"
- Next in thread: Stephane CHAZELAS: "Re: bash history customizing"
- Reply: Stephane CHAZELAS: "Re: bash history customizing"
- Reply: Thorsten Kampe: "Re: bash history customizing"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 28 May 2004 14:12:10 +0200
On Fri, 28 May 2004 11:22:16 +0200, Thorsten Kampe
<thorsten@thorstenkampe.de> wrote:
>* Gabkin (2004-05-28 08:55 +0100)
>> I also want to eliminate all duplicate commands in my history file,
>> but I want to keep the most recent duplicate only.
>> In other words if my history contains this...
>>
>> 1 cd $HOME
>> 2 vi somefile.txt
>> 3 cp somefile anotherfile
>> 4 exit
>> 5 cd $HOME
>> 6 vi somefile
>> 7 exit
>>
>> I would like it to become
>>
>> 1 cp somefile anotherfile
>> 2 cd $HOME
>> 3 vi somefile
>> 4 exit
>>
>> This way, over time most of my useful, regularly used commands would
>> rise to the top, while the useless ones would sift to the bottom of
>> the list. (for eventual manual purging?)
>>
>> The obvious way is via a sort -u, but this sorts alphabetically which
>> is totally not what I want.
>uniq or zsh
uniq cant do anything that a sort -u cant do, unless there is some
kind of uniq option to get rid of duplicates but keep the _last_
duplicate, not the first.
Also, I dont want to sort the history alphabetically, Im trying to
sort it by common usage.
As for zsh, I'm a bash man! (but does zsh have an evolutionary history
facility like this?)
- Next message: bill: "Re: Unix without shell"
- Previous message: Sven Mascheck: "Re: Unix without shell"
- In reply to: Thorsten Kampe: "Re: bash history customizing"
- Next in thread: Stephane CHAZELAS: "Re: bash history customizing"
- Reply: Stephane CHAZELAS: "Re: bash history customizing"
- Reply: Thorsten Kampe: "Re: bash history customizing"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|