Skip to content

Instantly share code, notes, and snippets.

@wazoox
Last active October 19, 2018 14:08
Show Gist options
  • Save wazoox/324797849094b0ee0907d88c3a245488 to your computer and use it in GitHub Desktop.
Save wazoox/324797849094b0ee0907d88c3a245488 to your computer and use it in GitHub Desktop.
Bash tricks
# bad wrapping of commands in bash
export HISTCONTROL=ignoredups:erasedups
# also try
export HISTCONTROL=ignoreboth
# if the terminal window was resized try
shopt -s checkwinsize
# one history common to all terminals:
export PROMPT_COMMAND="history -a;history -c;history -r;$PROMPT_COMMAND"
# edit the current shell line in your $EDITOR
# press Ctrl+(x, e)
# edit the last command in $EDITOR
fc
# ls only directories : put this in .bashrc
function lsd
{
ls -1p $* | grep '/$'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment