DEV Community

Discussion on: TIL about zshell startup

Collapse
moopet profile image
Ben Sinclair

I have this in my .bashrc, .bash_profile and .zshrc:

[ -f ~/.aliases ] && . ~/.aliases

That way I keep my aliases in a common file. Sure, some are shell specific but more likely they're OS specific, so inceptionally inside the .aliases file, I have stuff like this:

case $OSTYPE in
  linux-gnu)
    alias ls='ls --color --group-directories-first -FhN'
    ;;
  darwin*)
    alias ls='ls -FhG'
  ;;
esac
Collapse
nirnaeth profile image
Monica Author

oh this is so simple and yet so great!

I'll steal your idea :D