[Discuss] Reviewing history command output for productivity

noel at natnix.com noel at natnix.com
Mon Sep 25 12:04:03 PDT 2006


You guys and your wacky multiple terminal windows.  Kiss the Gnu, live
in Emacs.  I run bash in an Emacs buffer.  I rarely need more than one
bash buffer, since you can open mutiple buffers for files and man pages.
Since cutting and pasting is so easy in Emacs, if I need to reuse a long
shell command I save it from the shell to a notes file, then I can paste
it back in my shell buffer later.  Yes, I know you can open multiple files
in vim too, but having an umlimited buffer by running your shell in your editor
makes things like this much easier.

What am I saying?  This is Linux where pain is the name of the game.

Looks like you can do what you want in tcsh:
http://www.macosxhints.com/article.php?story=20020404095846769

but accorinding to the bash manpage, history files are only saved when
the shell exits.

--Noel






On Mon, Sep 25, 2006 at 11:19:49AM -0700, R. McFarlane wrote:
> Lloyd D Budd wrote:
> 
> >Review your history is a Linux productivity tip making the rounds.
> >
> >http://www.lifehacker.com/software/unix/review-your-most-oftused-unix-commands-202712.php 
> >
> >originally from
> >http://www-128.ibm.com/developerworks/aix/library/au-productivitytips.html?ca=dgr-lnxw07UNIX-Office-Tips 
> >
> >
> >The command they are recommending is:
> >history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq 
> >-c|sort -n
> >
> >Well, I use bash in multiple terminal windows, so how do the histories
> >for the various terminals interact?
> >
> >For most re-occurring longer commands I access them through ctrl-R as
> >opposed to an alias or function.
> 
> 
> 	I too simply use the "reverse search" shortcut, but it is hindered 
> 	by the history buffer limit. If you history only stores the last 1000 
> commands and it was the 1001 command you needed, you are out of luck. :(
> 	I am not sure if this is doable, but it sure would be nice if the 
> 	bash history was live updating. This way, when I have multiple windows open 
> and I do a "reverse search", I can get to the command from any window.
> 	In addition, it would be nice if my bash history and screen history 
> were all one. Again, this would simplify searching my command history.
> 	Anyone have any solutions for this?
> _______________________________________________
> Discuss mailing list
> Discuss at vlug.org
> http://ladybug.vlug.org/cgi-bin/mailman/listinfo/discuss


More information about the Discuss mailing list