Shell Arguments →
This in-depth article clarifies how your shell deals with word-splitting, quoting, and expansion. Well worth the read if you do any work in the shell.
I develop beautiful, compelling
experiences on the web and beyond.
This in-depth article clarifies how your shell deals with word-splitting, quoting, and expansion. Well worth the read if you do any work in the shell.
The easiest way to speed up your workflow in your shell is to create aliases for your most frequently used applications and their configuration settings. If you use zsh, these aliases can go into ~/.zshrc, but if you use bash they should go in ~/.bash_profile.
A few sample aliases from my for git:
alias g='git'
alias ga='git add'
alias gc='git commit -m'
alias gac='git add -u && git commit -m "Auto commit"'
Now, when I’m on my prompt, the aliases will be expanded by my shell after I hit return to execute the command.
$ gc 'This is my commit message'
Expands to:
$ git commit -m 'This is my commit message'
You can also use this to set default options for commonly used programs.
For example, let’s say you want to have ls display its output in list mode with color on OSX. I can just set up an alias like:
alias ls='ls -lG'
And now when I invoke ls on my prompt, it will automatically expand it as follows:
$ ls -a /path/to/foo
Expands to:
$ ls -lG -a /path/to/foo
alias p='pushd'
alias o='popd'
alias s='cd -'
alias rcedit='mvim -f ~/.zshrc && source .zshrc'
alias hostedit='sudo mvim -f /etc/hosts && dscacheutil -flushcache'
Share your custom shell aliases and tips in the comments.
Here is a quick script that lets you easily check the freshness of your git repository branches.
Place this script somewhere in your PATH and make it executable. This script can then be ran within any git repository by calling `git fresh` within the repository.