A downloadable tool

Download NowName your own price

The first bash-based utility on itch.io, session.bash is a small addition to one's bashrc that makes it easier to manage bash history using the concept of "sessions".

A session is simply a history file. The script provides the session function to switch sessions/history files: it manages saving and loading the relevant history files, as well as optionally switching the current directory. To enable cd functionality, the setsessioncwd function is used.

The savecwd function is provided as a convenience to store the current directory as part of history, without automatically switching to it on session load.

By default, the script prepends the session to PS1. This can be overriden.


Using the script might look like this:

{@ default} soniex2@pc:~$ session blog
{@ blog} soniex2@pc:~/blog$ vim something.xhtml
{@ blog} soniex2@pc:~/blog$ deploy ...
{@ blog} soniex2@pc:~/blog$ session projectnew
{@ projectnew} soniex2@pc:~/blog$ mkdir ../projectnew && cd ../projectnew
{@ projectnew} soniex2@pc:~/projectnew$ setsessioncwd
{@ projectnew} soniex2@pc:~/projectnew$ exit

It can also be used with multiple shells. Note, however, that sessions aren't synchronized across shells.

Average sessionA few seconds
LinksSource code


Download NowName your own price

Click download now to get access to the following files:

bashsession.tar 50 kB