The Linux terminal and version control
1. Terminal basics
The Terminal is an interactive, text-based interface for your Operating System. When you type a command, you're basically telling your computer to do something very specific. Many commands will print information to the screen. Some will ask for input, and others may just return you to a prompt.
The quickest way to install, remove or update applications is through the Terminal. The Terminal is also referred to as the shell, command line, prompt, or command prompt.
To open a Terminal, tap the Super Key , to search your computer and type the word Terminal.
A box like the one below will appear:
Navigating The Terminal
It might not look like much, and at first glance there might not appear to be much information, but the Terminal is one of the most powerful tools at your disposal. Take a look:
|Current User||The username of the person currently logged in to this Terminal.|
|Current Host||The hostname of the system currently in use by the Terminal. Unless you've connected to a remote machine via SSH, this will be the same name as your computer.|
|Current Directory||The current folder that this Terminal resides in. Commands entered and files modified are scoped to this folder, unless providing an absolute path to another file or folder, or if the command is available in the user's $PATH. Basically, the Terminal can only see into this folder. A tilde (~) indicates the user's home directory.|
|Prompt||Anything entered after this symbol is interpreted as a command.|
|Typed Command||Anything that is typed into the Terminal is shown after the prompt.|
|Cursor||A visual indicator of the user's current position in the Terminal.|
As you change folders and move throughout your computer, the prompt will change in response. In many cases, you won't need to move around to run a command.
To list all files and folders in the current directory, type
Running Elevated Commands
In most cases, the Terminal prevents you from damaging your system by requiring authentication or elevated privileges to run certain commands. For example, to check for updates you will need to prepend the command
When you run a command with
sudo apt update
This command will tell your system to search for potential updates and advise if there are any available, but this command does not install them.
sudo apt upgrade
This command will download and apply any updates to your System76 computer.
sudo apt full-upgrade
This command will upgrade your packages and installs or remove packages to resolve dependencies so everything is up-to-date.
sudo apt install [application]
This will install a particular application and its dependencies on your computer.
sudo apt purge [application]
This will remove a program and it's configuration files from your computer.
This page is a version of the System76 article on Terminal basics.