Zsh

From NoskeWiki
Jump to navigation Jump to search

About

This page is a child of: Unix


The Z Shell (zsh) is a powerful command-line interpreter for Unix operating systems, designed to be interactive and compatible with the Bourne shell (sh) and extended with many improvements geared towards both scripting and interactive use. Zsh became the default shell for macOS starting with macOS Catalina (version 10.15), released on October, 2019.

Child Pages

Related/Child Pages:


Config

To configure bash as your default shell use:

chsh -s /bin/zsh

And a good place to change the prompt plus add alases and all that other good stuff edit your ~/.zshrc file.

pico ~/.zshrc

If you install Oh My Zsh it will get started with this file for you.


Overview

Zsh is known for its improvements over other shells in terms of features, scripting capabilities, and interactive use. It incorporates elements from other Unix shells like Bash and ksh. The shell is highly customizable, allowing users to modify its behavior and appearance extensively.

Features

  • Command Line Editing: Provides advanced command-line editing, auto-completion, and spelling correction.
  • Themes and Plugins: Supports themes and plugins, significantly enhanced by frameworks like Oh My Zsh.
  • Scripting Language: Zsh scripting language is powerful, supporting features like associative arrays and string manipulation.
  • Compatibility Mode: Can emulate sh or ksh when started as sh or ksh, ensuring compatibility with existing scripts.

Usage

Zsh can be used as an interactive login shell and as a powerful command processor for shell scripting. It is particularly popular among developers and power users due to its user-friendly features and extensive customization capabilities.

Installation and Configuration

Zsh can be installed via package managers on most Unix-like operating systems. Configuration files for zsh include `.zshrc` for interactive shell configurations and `.zshenv` for setting environment variables.

Resources