Skip to content

Operating System Shellλ︎

A shell is a computer program that exposes an operating system's services to a human user or other programs.

Operating system shells use either a command-line interface (CLI) or graphical user interface (GUI), depending on a computer's role and particular operation. It is named a shell because it is the outermost layer around the operating system.

Command-line shells require the user to be familiar with commands and their calling syntax, and to understand concepts about the shell-specific scripting language (for example, bash), while graphical shells place a low burden on beginning computer users and are characterized as being easy to use, yet most GUI-enabled operating systems also provide CLI shells, normally for performing advanced tasks.

Wikipedia: Shell - Computing

Command Line Shellλ︎

  • bash Bourne Again Shell created as a free version of the Bourne Shell (sh)
  • zsh is an advanced shell with programable command-line completion, extended file globbing, improved variable & array handling and themeable prompts

Rich promptλ︎

The default shell prompt shows minimal information, e.g. an idicator if a user account is root (#) or regular user account ($).

A richer and more informative experience by adding a prompt theme.

Starship provides a cross-shell prompt that conveys more information about the current shell (path, time, execution time of commands, etc.).

Practicalli Custom version of Starship Cappuccin Powerline preset

Aliasesλ︎

Define aliases to optimise commands and create useful default flags when calling commands

Use a shell-aliases file to define aliases to be used with any command line shell.

Shell Aliases

# Shell aliases shared across all shells (zsh, bash)

# Neovim Aliases for multiple configurations
alias astro="NVIM_APPNAME=astronvim nvim"

# Neovide alias with AstroNvim configuration
alias neovide="NVIM_APPNAME=astronvim neovide"

# Shell history
# edit entire history
alias edit-shell-history="fc -W; astro \"$HISTFILE\"; fc -R"

# edit previous command in history
alias edit-last-command="fc -e astro -1"

Source the shell aliases from the shell configuration files

Source Shell Aliases for Zsh

.config/zsh/.zshrc
# Source Shell Aliases
[[ ! -f ~/.config/shell-aliases ]] || source ~/.config/shell-aliases

Source Shell Aliases for bash

.bashrc
# Source Shell Aliases
if [ -f $HOME/.config/shell-aliases ]; then
    source $HOME/.config/shell-aliases
fi

GUI Shellλ︎

Gnome, KDE, Regolith are examples of desktop shells.