set -o vi
emacs-style line-editing set -o emacs51–60 of 288 posts
set -o vi
emacs-style line-editing set -o emacsalias grpe=grep Nothing comes close to the amount of time I saved with this one.
best. alias. ever.
alias myip='curl -s https://api.ipify.org'
Just prints out my current public IP address. I also have a bunch of others mentioned in this thread, and I've abbreviated a bunch of self-explanatory docker-compose commands, e.g. dcdown, dcup, dcrestart, dcpullup, etcalias grpe=grep Nothing comes close to the amount of time I saved with this one.
Hehe I liked the 'lcoate' one on this page too, same idea. It might be super-useful to have a function that, if command not found and if there's an anagram of what you typed that is a command, asks if you meant that instead, y/n? (That would make computers seem a lot more intelligent!)
function workspace_cd() {
cd $@ && [ -f ".bashworkspace" ] && source .bashworkspace
}
alias wscd="workspace_cd"
Each .bashworkspace file contains something like this: export GOPATH={PATH HERE}
export PATH=$GOPATH/bin:$PATH
export GHC_PACKAGE_PATH={PATH HERE}Since I'm working in git repos the majority of the time, I type these hundreds of times per day: alias s="git status" alias d="git diff" I prefer looking at this stuff in a terminal rather than an IDE. Reducing them to a single character just feels so good. Note: not a git alias like "git s", literally just the single character "s" in Bash itself. And coming in third: alias ..="cd .."
alias ..="cd .." If you use zsh, typing a directory name changes to it automatically. It’s almost always a very delightful thing.
set autocdThis is tiny, but I've gotten a surprising amount of mileage out of aliasing 'fx' to firefox --new-instance --profile $(mktemp -d) which pops open a new instance of Firefox with a completely clean, temporary profile. Super useful for testing sites or add-ons without influencing (or being influenced by) by my normal browsing profile.
di = diff
dc = diff --cached
ap = add -p
unstage = reset HEAD -p
discard = checkout -p
ci = commit -v
ca = commit -va
amend = commit -v --amend
reword = commit -v --amend --only
extend = commit -v --amend --no-edit
ri = rebase -i
rem = rebase master
rim = rebase -i master
red = rebase development
rid = rebase -i development
continue = rebase --continue
skip = rebase --skip
pu = push -v --progress
poof = push -v --progress --force-with-lease
pusu = -c push.default=current push -v --progress --set-upstreamOut of everything I like this little alias the most: cls="clear; ls" It harkens back to DOS. Clearing the screen followed by ls happens surprisingly often, if not just to start things in "clean slate". I'm quite fond of it.