# Brushing up on zsh and Oh My Zsh

[Canonical article](https://www.ashryan.io/writing/brushing-up-on-zsh/)

Published: 2019-11-11

Since macOS has now moved from bash to zsh, it seems like a fine time to revisit the basics of my preferred shell.

I use the command line daily and it’s an indispensable part of how I get things done on my Mac and remote machines. However, it’s probably also an area I don’t explore as much as I should. I’m fairly set in my ways on the command line.

I’ve been using zsh, powered up by [Oh My Zsh](https://ohmyz.sh/?ref=ashryan.io), as my shell for years now. Certain conveniences this combination provides (like being able omit `cd` when navigating with `..` \[aka, “autocd”], or being able to use the tab and arrow keys to autocomplete and select directory contents) are deeply engrained in how I use the command line.

Since [macOS has now moved from bash to zsh](https://www.theverge.com/2019/6/4/18651872/apple-macos-catalina-zsh-bash-shell-replacement-features?ref=ashryan.io), it seems like a fine time to revisit the basics of my preferred shell.

I did a quick runthrough of Wes Bos’s [Command Line Power User course](https://commandlinepoweruser.com/?ref=ashryan.io) and ended up picking up a few things I hadn’t learned about zsh before:

1. `take `is convenient shorthand for `mkdir && cd`
2. `...` will move you up two directory levels
3. “` -` + tab” will list the valid flags you can pass to the command (e.g., `ls -` + tab)
4. [Oh My Zsh’s `z` plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/z?ref=ashryan.io) uses your directory navigation history to give you quick access to “frecent” (frequent + recent) locations on your machine

Also, while not specifically a zsh/Oh My Zsh tip, Wes also recommended using the [Node.js `trash-cli` module](https://github.com/sindresorhus/trash-cli?ref=ashryan.io#readme) instead of `rm` for deleting files and directories. The `trash` command moves your deleted items to the OS trash can, rather immediately obliterating them from existence, the way `rm` does. I thought this was a great tip, and something I’d like to start remapping my brain to doing.

A couple of other zsh resources on my list for another time:

- [https://scriptingosx.com/zsh/](https://scriptingosx.com/zsh/?ref=ashryan.io)
- [https://github.com/rothgar/mastering-zsh](https://github.com/rothgar/mastering-zsh?ref=ashryan.io)
