Getting started with the terminal

This is a simple guide to help new users get started with the terminal. The terminal takes keyboard input only and commands can vary between different operating systems. The below commands are used in Ubuntu's GNOME terminal and will also work in many other distributions of Linux. If they don't then you will need to research the equivalent commands for your specific distribution.

Opening a terminal window

Open the GNOME Launcher and launch the application for Terminal.

On most Linux distributions, the terminal can also be directly accessed with the key combination: Ctrl + Alt + T

Tab is your friend

This might sound strange but it is one of the most used phrases here at Star Labs. Pressing the tab key completes any commands or filenames. For example, if you enter do and press the tab key, you will see a list of all of the commands that start with do:

do
done
dosfsck
domainname
do-release-upgrade
dosfslabel

Depending on what you enter, there may be 1 to 100 possible commands. If there is only 1 command, tab will complete it. For example, if you type do-r and press tab, it will complete to:

do-release-upgrade

Navigating the file system

The fundimental thing to learn is how to navigate around the file system. The command pwd stands for Print Working Directory.

pwd

This will output the current directory you are in. Each time you open a terminal window, it will open in your home directory:

/home/star

To change directory, you need to type cd followed by the folder name. For example:

cd Desktop

To leave the current folder and return back to the parent folder, you can use:

cd ..

You can use the command ls to find out which files and folders are in the current directory:

ls

To show hidden files, add the -a switch to the end:

ls -a

Navigating the file system

Run command as super user:

sudo

Installing a specific program:

sudo apt install *Program

Update installed packages:

sudo apt update

Update installed packages without having to press Y or N to confirm or deny the action:

sudo apt upgrade -y

Update installed packages and dependencies without having to press Y or N to confirm or deny the action:

sudo apt dist-upgrade -y

Remove dependencies that are no longer used by the system:

sudo apt autoremove

Remove a specific program from the machine: search for keywords that match programs installed on your machine:

sudo apt list --installed | grep *keyword

Read a specific file via terminal:

cat *filename

Edit or create a new file within terminal:

nano *filename*

Contact Us

Not finding what you're looking for? Contact Us Directly