Home » Debian, How-to, Linux, Newbie, Shell

shell_sink: my new shell history

10 February 2009 No Comment

Another great program released by opensource community is shell_sink. shell_sink is a little program what is capable to export your shell history (bash or zsh) over the internet. So you can tag your commands, aggregate them from multiple computers, annotate, search and export them in a RSS feed.

Using it is easy:

1. Login to shell_sink site with your google account (http://history.shellsink.com/ ).
2. Copy your unique id from the Preferences page and configure (right now you can only disable the atom feed and filter your commandnds by tag).
3. Install the client application in your *nix station.

Installing also is very easy:

Under Debian just add shell_sink repository:

deb http://ppa.launchpad.net/shellsink/ubuntu hardy main

and run:

$ sudo apt-get update
$ sudo apt-get install shell_sink

If you use bash just append the following lines to your .bash_rc file:

shopt -s histappend
export SHELL_SINK_COMMAND=shellsink-client
export SHELL_SINK_ID=your-hex-id
PROMPT_COMMAND=”history -a;$SHELL_SINK_COMMAND”
export SHELL_SINK_TAGS=colon:delimited:list:of:tags

and you are ready to use. Just logout from your bash shell and login back.

If you use zsh just append the following lines to your .zshrc file:

# number of lines kept in history
export HISTSIZE=1000
# number of lines saved in the history after logout
export SAVEHIST=1000
# location of history
export HISTFILE=~/.zhistory
# append command to history file once executed
setopt inc_append_history
# execute shellsink before a new command is run
function precmd {
/path/to/shellsink-client;
}

and do a symlink from .zhistory to .bash_history

ln -s ~/.zhistory ~/.bash_history

now just logout and login and you are ready to use the shell.

Installing from sources is also very easy because the client is coded in python, but also you can get “binaries” for other distributions/platforms from here

Good Luck!


Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.