This is a shotgun blast of commands I use from terminal for fun and profit. Some say I'm crazy for living in the "black screen", I like to think of it as a Terminal Illness.
Most used commands
history | awk '{print $2}' | sort | uniq -c | sort -n
# Build a command
ls | awk -F '.' '{print("git mv " $0 " " $1 ".yml")}'
# Then execute it
ls | awk -F '.' '{system("git mv " $0 " " $1 ".yml")}'
Remember that command that you spent all that time writing? Now you will!
# ~/.bashrc
HISTSIZE=9999999
HISTFILESIZE=9999999
shopt -s histappend
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
Give ctrl-r (reverse search history) super powers with fuzzy search.
Old: history
New: fzf
git clone https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
# ~/.bashrc
# set height to full screen
export FZF_CTRL_R_OPTS='--height 100'
brew install entr
apt-get install entr
find . | entr -cs 'echo something changed at `date`'
find . | entr -cs 'pytest'
cat ~/Downloads/results-20201030-111437.csv | column -ts ',' | less -S
banner -w 50 done | snail
# A slower tail -f
# Example:
# cat foo | snail
# cat bar | snail 0.1
function snail() {
awk -v s="${1:-'0.3'}" 'system("sleep " s) {exit} 1'
}