Last active
October 19, 2018 14:08
-
-
Save wazoox/324797849094b0ee0907d88c3a245488 to your computer and use it in GitHub Desktop.
Bash tricks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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