Let’s get to know the Linux Command Line Interface (CLI).
- A bit of history
- First look at the command line
- Command syntax
- Basic commands
The Linux command line is a text interface to your computer.
Also known as shell, terminal, console, command prompts and many others, is a computer program intended to interpret commands.
Allows users to execute commands by manually typing at the terminal, or has the ability to automatically execute commands which were programmed in “Shell Scripts”.
A bit of history
The Bourne Shell (sh) was originally developed by Stephen Bourne while working at Bell Labs.
Released in 1979 in the Version 7 Unix release distributed to colleges and universities.
The Bourne Again Shell (bash) was written as a free and open source replacement for the Bourne Shell.
Given the open nature of Bash, over time it has been adopted as the default shell on most Linux systems.
First look at the command line
Now that we have covered some basics, let’s open a terminal window and see how it looks!
When a terminal is open, it presents you with a prompt.
Let's analyze the screenshot above:
Line 1: The shell prompt, it is composed by
- Username: our username is called “john”
- Hostname: The name of the system we are logged on
- Location: the working directory we are in
- $: Delimits the end of prompt
$ sign, we can type a command and press Enter for this command to be executed.
Line 2: After the prompt, we have typed the command
whoami which stands for “who am i“ and pressed [Enter] on the keyboard.