-
-
Save anonRegions/f1b52ad5125ea54ab743 to your computer and use it in GitHub Desktop.
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
# set these in your .bash_profile, .bashrc, .zshrc first | |
HISTFILESIZE=100000 # how many lines to keep total | |
HISTSIZE=100000 # how many lines to keep for the current session | |
# oh-my-zsh will default to a reasonable 10000, but most bash defaults to a few hundred | |
# oh-my-zsh by default appends all commands to history after they are run instead of on session end | |
# search the history with control-r | |
# search for commands starting with the one you typed with alt-p | |
# if you don't want something to stay in your history, prefix the command with a space | |
# on zsh, setopt HIST_IGNORE_SPACE | |
# most used commands | |
history | tr -s ' ' | cut -f3 -d ' ' | sort | uniq -c | sort -nr | head -n 30 | |
# most used commands including args | |
history | tr -s ' ' | cut -f3- -d ' ' | sort | uniq -c | sort -nr | head -n 30 | |
# when you forget to sudo | |
sudo !! | |
# when you don't want to type out the args again | |
cp a-very-long-file-name.txt a-very-long-file-name.txt.bak | |
subl !^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment