Gentoo Archives: gentoo-user

From: Stroller <stroller@××××××××××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Questions about History file
Date: Wed, 08 Jan 2014 22:09:45
Message-Id: 25822647-C413-4A2B-B7A3-B130390C6747@stellar.eclipse.co.uk
In Reply to: Re: [gentoo-user] Questions about History file by Bruce Hill
1 > http://mywiki.wooledge.org/BashFAQ/088
2
3 The advice here to use awk to "compress" log files seems a bit dated.
4
5 Bash now allows you to set in .bashrc:
6
7 export HISTCONTROL=erasedups
8
9 I don't know that there's an "ultimate answer" to history management.
10
11 Personally, for years I have had my prompt set to show the history number of the current command, so I can look up on the screen and just enter !505 to reuse a previous comment. I reality, I never use this, but a terminal wouldn't feel like a terminal, for me now, without having numbered prompts up the screen.
12
13 More practically I tend to use tmux and open new panes for each task or task group, keeping task sets short and closing the pane when I've done that little job (or sub-job). This allows Bash itself to manage its history more efficiently.
14
15 If I need to use a previous command and ctrl-R doesn't easily find it, I tend to just `history | grep hint` to find it.
16
17 I also set HISTSIZE and HISTFILESIZE to 900, so to maximise the number of previous commands available to me by typing only a three digit !321.
18
19 Stroller.