zsh
An interactive shell close to bash in syntax, and the default login shell on macOS since Catalina (10.15).
In more detail
Everyday commands such as cd, ls and echo work the same in zsh as in bash, but zsh differs in details such as array indexes starting at 1 and unquoted variables not being word-split by default. It reads ~/.zprofile for login shells, which is where PATH changes usually go on a Mac, and its prompt usually ends in %. Scripts should still name bash in their shebang so they do not depend on whichever shell a user happens to log in with.
Related terms
- Bash — The GNU shell: a program that reads commands, typed or from a script, and runs them.
- login shell — The shell your account starts when you log in, recorded in the user database and shown by the SHELL variable.
- macOS — Apple's operating system for Mac computers, built on a Unix-like core called Darwin.
- shell — The program that reads the commands you type, runs them and shows the results; sh and bash are common ones.
- shell profile — A startup file the shell runs when it opens, used to set PATH and other settings for every session.
Taught in
- What A Shell Is, And What Bash Is — Bash Scripting & Command Line Automation
- Which Shell Am I In, And Getting Bash Five — Bash Scripting & Command Line Automation
- Installing Python On A Mac — Hands-on Python: Complete Video Course & Book
- First Run, And Fixing A Broken Install — Hands-on Python: Complete Video Course & Book