Skip to content

Instantly share code, notes, and snippets.

View kryptt's full-sized avatar
:octocat:
Looking for inspiration

Rodolfo Hansen kryptt

:octocat:
Looking for inspiration
View GitHub Profile
@mdshw5
mdshw5 / .bashrc
Last active November 24, 2017 10:31
bash history in each writeable working directory
#!/bin/bash
# per-directory history
shopt -s histappend # always append to history, don't replace
export PROMPT_COMMAND="builtin history -a;$PROMPT_COMMAND" # write to history file at every new prompt
export HISTTIMEFORMAT="%m/%d/%y %T "
alias cd='cd_with_local_history'
alias history='cat $HOME/.bash_history'
export HISTFILE="$PWD/.bash_cwd_history_$USER"
function cd_with_local_history()