Unit content
Shells and the command line
A shell is a program that reads commands and launches other programs. It provides a textual interface for working with files, processes and operating-system tools.
Commands and arguments
A command line contains a program name followed by arguments:
cp report.txt backup.txt
The shell parses the text and asks the operating system to start the requested program with those arguments.
Current directory and paths
The shell process has a current working directory. Relative paths are interpreted from that directory, while absolute paths begin at the filesystem root.
Commands such as cd, pwd and directory-listing tools make navigation explicit.
Redirection
Standard input and output can be connected to files:
program > result.txt
program < input.txt
Pipelines
A pipeline connects one process's standard output to another process's standard input:
producer | filter | consumer
This lets small independent tools be composed into larger workflows.
Environment and exit status
Shells pass environment variables to child processes and receive an exit status when a command terminates. Scripts use these mechanisms to automate repeated command-line procedures.
The shell is therefore both an interactive interface and a programming environment for composing operating-system processes.