Terminal Fun: The Basic Commands

Today I will introduce you to the wonderful wacky world of Terminals! First let’s open your terminal, this will vary depending on what distribution of Linux you are running. For Kubuntu you can open it by clicking the launcher -> Click in the top search bar -> Type “Konsole” -> Press Enter. You should then be greeted with a screen similair to this.

Empty Terminal Session
Konsole showing an empty terminal session

First let’s get a feel for navigating around the terminal session. For this will will use the command CD also known as “Change Directory”. You can CD to many places within your file system quite easily, for example you could use these commands

cd / This command will take you to the root of your current file system

cd ~ This will take you to the current users documents home folder

cd .. This will take you up one directory

So if you were interested in checking out your friends documents you could type this command cd /home/friend/documents and it would change the terminal to be in your friends documents folder. Now the question is how do you see what’s in this folder. In order to view files and folders from within the terminal you need to use the command ls meaning to list the contents. You can simply type ls within the terminal to see a basic list of it’s contents however unlike cd there are many switches that can be turned on for ls. Let’s now go over several of the switches for ls.

If you just type ls you will see all folders that are easily accessible meaning you will not see files or folders that are hidden. To see all contents you may type ls -a You will know the file/folder is hidden if it begins with a period like this .hidden 

So now you have navigated successfully to your friends documents folder and seen it’s contents everything seems rather boring but you spot one file named secrets.txt. Now how could you view this text files contents from within the terminal? Well there are many ways but of of the easiest is to use cat like this:

Using the Cat Command in Konsole
Using the Cat Command in Konsole

Leave a Reply