Welcome to the Shell! The command line interface (CLI) is a powerful tool that allows you to interact with your computer by typing commands. While graphical user interfaces (GUIs) are user-friendly, the command line offers greater power, flexibility, and automation capabilities.
A shell is a program that provides an interface for users to interact with the operating system. It interprets commands that you type and passes them to the operating system to execute.
There are various types of shells available, including:
In this tutorial series, we'll primarily focus on Bash, as it's the most widely used shell and the default on most Linux distributions.
People often use the terms "shell" and "terminal" interchangeably, but they're actually different:
Think of the terminal as the container, and the shell as the program running inside it.
Learning the command line offers several advantages:
Let's start with a few basic commands to get familiar with the shell. Try typing these in the interactive terminal below:
Here are some basic commands to try:
Command | Description | Example |
---|---|---|
echo |
Display text on the screen | echo "Hello, World!" |
date |
Display the current date and time | date |
whoami |
Display your username | whoami |
pwd |
Print Working Directory (show current location) | pwd |
ls |
List files and directories | ls |
Most shell commands follow a similar structure:
command [options] [arguments]
For example:
ls -l /home
In this command:
ls
is the command-l
is an option that displays results in a detailed list format/home
is the argument specifying which directory to listTry using the ls
command with the -l
option to see more details about files. What additional information does this show you?
When you're not sure how to use a command, you can get help in several ways:
man command
- Display the manual page for a commandcommand --help
- Display brief help informationhelp command
- Display help for shell built-in commandsFor example, to learn more about the ls
command, you can type man ls
or ls --help
.
In this tutorial, you've learned:
In the next tutorial, we'll dive deeper into navigating the file system and working with files and directories.
Create a free account to track your progress, save your favorite commands, and unlock achievements as you learn.