Site Tools


wiki:shell

**This is an old revision of the document!**

Table of Contents

shell

Shell is a command interpreter that lets you run programs and orchestrate them. Type commands in the terminal, chain programs via pipes, redirect input/output, and run jobs in the background. The shell parses what you type, finds the program, passes arguments, and handles environment variables.

The most popular shell on GNU/Linux is Bash. Other shells include sh (POSIX standard), zsh, and fish. All shells follow similar principles but differ in syntax and built-in features. Scripts written for POSIX sh work across shells; Bash-specific features like associative arrays do not.

$ echo "Hello, world"           # run a command
$ ls -la /tmp | grep config     # pipe output to another command
$ ./script.sh &                 # run in background
$ VAR=value ./program           # set environment variable

The shell is also a programming language. You can write scripts (shell files) with variables, conditionals, loops, and functions to automate tasks.

Concepts

wiki/shell.1787159386.md.gz · Last modified: by 127.0.0.1