This site is now 100% read-only, and retired.

Making The Bash History More Useful

Posted by giosue_c on Tue 10 Feb 2009 at 08:50

Since I began programming I have worked on at least a hundred different computers: university workstations, my own computers, dozens of employer and client workstations. Each one had a history file loaded with commands that I begged, borrowed, stole, sweated and cried for. Countless hours of work now long gone or rotting somewhere in a stack of backups. Everyone, please. A moment of silence for all the shell commands that have gone into the bit bucket never to be heard from again. Even the mean ones that hosed my system. Especially those. Ladies and Gentlemen I come before you now to swear that never again will I lose this information. Now with shell-sink I keep all that lovely data handy no matter where I am. On top of that I can organize and group useful sets of commands and have them at my fingertips when I need them. I dedicate the Shell-sink tool to the memory of all those late night sed and awk one liners that have saved millions of lives, but faded from memory all too quickly. Features include:
  • Permanent and unlimited storage of bash history
  • Pull commands back out of the sink and into your shell based on a tag or keyword
  • Searchable bash history
  • Tagable bash history
  • Annotateable bash history
  • Aggregate bash history from multiple computers into one grand unified history
  • RSS feed of your bash history that you can filter
Shell-sink stores your bash history in Google's big table. Development is ongoing. And I have an ever growing feature list including command statistics, and powerful ways to share and document groups of commands. A guide to get started can be found here. Debian/Ubuntu packages exist to make installation and updates a snap. But installation is pretty easy on other unix based systems. So far nobody has used the sink but me, so if you try it out please drop me a line with some feedback. There is a google group that would be a perfect place to leave feedback.

 

 


Re: Making The Bash History More Useful
Posted by madduck (2001:0xx:0xx:0xxx:0xxx:0xxx:xx) on Tue 10 Feb 2009 at 17:42
The problem with this approach is obvious: it probably won't work offline properly. I think it's better to get in the habit not to rely on history to store knowledge, but to use it only for convenience. Document your stuff, keep a log, and remember: the traits of a true sysadmin are laziness and hubris; if you run the same set of commands a second time in the same order, you did something wrong not writing a script the first time around. :)

[ Parent ]

Re: Making The Bash History More Useful
Posted by Anonymous (68.147.xx.xx) on Tue 10 Feb 2009 at 22:41
"you did something wrong not writing a script the first time around"

I disagree. Use the sequence once: no fault. Use them a second time: maybe let it slide. Use them a third time? That had better scream 'script it'!

M.

[ Parent ]

Re: Making The Bash History More Useful
Posted by Anonymous (71.62.xx.xx) on Tue 17 Feb 2009 at 13:01
I agree with M. First time no problem. Second time, arrow up to use that bash history. Third time, thinking about a script.

-BMcG

[ Parent ]

Re: Making The Bash History More Useful
Posted by Anonymous (84.59.xx.xx) on Wed 11 Feb 2009 at 03:33
"Getting started:
1.Login to shell_sink with your google account."

Okay, Google account. 'nuff read........:-(

[ Parent ]

Re: Making The Bash History More Useful
Posted by k8to (64.142.xx.xx) on Wed 11 Feb 2009 at 15:19
So many commands I don't want stored on google.

silly-program -auth:username:password

less downloaded-tporn-that-happens-to-include-children-unexpectedly.tx t

[ Parent ]

Re: Making The Bash History More Useful
Posted by Anonymous (217.45.xx.xx) on Wed 11 Feb 2009 at 15:42
This seems to be a solution desperately in search of a problem.

[ Parent ]

Re: Making The Bash History More Useful
Posted by Anonymous (84.106.xx.xx) on Wed 11 Feb 2009 at 19:34
Although I admire the effort put into building new utilities, this one is definitely a big no-go in terms of security. I'm sorry.

[ Parent ]

Re: Making The Bash History More Useful
Posted by slash5toaster (65.209.xx.xx) on Thu 12 Feb 2009 at 04:26
I was excited up to the point I read about sending my history offsite. too many passwords dumped on the command line. too much detail about my system structure. If I could do this locally, then wow.

Try rebuilding with an encrypted db and I am all in.

[ Parent ]

Re: Making The Bash History More Useful
Posted by Anonymous (71.236.xx.xx) on Fri 13 Feb 2009 at 17:58
Maybe this approach needs to encrypt the file before storing it offsite.

[ Parent ]

Re: Making The Bash History More Useful
Posted by Anonymous (82.204.xx.xx) on Wed 18 Feb 2009 at 12:44
> Maybe this approach needs to encrypt the file before storing it offsite.

Yup, agree. Did something like that as outlined in http://blogs.srijan.in/2008/06/06/automatically-mailing-a-daily-b ackup/

[ Parent ]

Re: Making The Bash History More Useful
Posted by Anonymous (212.178.xx.xx) on Thu 5 Mar 2009 at 08:33
I'd say, use CTRL-R instead..

[ Parent ]

Re: Making The Bash History More Useful
Posted by Anonymous (84.77.xx.xx) on Sun 8 Mar 2009 at 02:37
skeksi@upolu:~$ cat .bash_logout

history -a ~/.history/tmp
cat ~/.history/tmp | tee -a ~/.history/`date +%d-%m-%y`.txt >> ~/.bash_history
tail -n $HISTFILESIZE ~/.bash_history > ~/.history/tmp
/bin/mv -f ~/.history/tmp ~/.bash_history
--

i usually copy a .bash_logout like that... it's not perfect but sometimes its usefull :D

[ Parent ]

Re: Making The Bash History More Useful
Posted by jhill10110 (216.45.xx.xx) on Fri 10 Apr 2009 at 18:42
This might sound convenient but it is a major security problem. If there is a security breach at shell_sink the attacker would have access to a wealth of information about your systems.

[ Parent ]

Re: Making The Bash History More Useful
Posted by Anonymous (80.126.xx.xx) on Tue 12 May 2009 at 23:11
Hear, hear!

[ Parent ]