Useful Shell Aliases

Like any good computer person, I maintain a collection of dotfiles. Mine is pretty basic. I don’t use any crazy zsh package manager framework thing or external dependencies. I do have a bunch of aliases, however, that I think are pretty helpful. I’m sharing them here. I hope some of these are useful to other people.

LS Aliases

These three are pretty straightforward. You probably already have one or more of these if you’ve customized your shell at all.

alias ls='ls -G'

Always show colors for ls.

alias l='ls -lG'

Show directory contents in list mode.

alias ll='ls -aGl

Directory contents in list mode with color.

Package Manager Stuff

alias brewup='brew update && brew upgrade'

Update and then upgrade Homebrew if that was successful.

alias gemup='gem update --system && gem update'

Update all Ruby gems.

alias allup='brewup && gemup && mas upgrade'

Upgrade Homebrew, Ruby gems, and the Mac App Store together. If any fail, stop so I can fix it.

alias ibrew=’arch -x86_64 /usr/local/Homebrew/bin/brew’

For the time being, there’s enough x86 only Homebrew packages that I’m running both the x86 and ARM versions in parallel. Maybe I should just run the x86 version for everything? For the time being, at least, I have this alias to run the x86 version.

Grab Bag

alias zshconf='bbedit -w $HOME/.zshrc && source $HOME/.zshrc'

Open zshrc in BBEdit and then source it after it’s done being edited.

alias in="arch -x86_64"

Run any command in x86 mode.

alias ded='rm -rf ~/Library/Developer/Xcode/DerivedData'

Delete Xcode derived data. Make sure you close Xcode before running or it will complain. Thanks Brent!

alias domains_grep="defaults domains | sed 's/,/\n/g' | grep -i"

Grep to find the user defaults domain of something.

take() { 
    mkdir $1 && cd $1 

Create a directory and change to to it.

Collin Donnell @collin