Terminal Commands in Ubuntu Linux

The Linux Terminal is a very powerful application and can be used to achieve just about anything.
I am going to run through some of the basic commands that you need to know, to get setup using Linux and on your way to becoming a command line master.
An important point to mention before we go any further with terminal commands is the use of ‘sudo’ or ‘root’ privileges. Sudo or root is required to run commands using elevated privileges. 
The Terminal has a manual built into it with entries for all commands. This includes a description of what the command does and how it can be used.
The manual page can be accessed by typing ‘man <name of command>’. So, to see the manual page for ‘sudo’, we would type, ‘man sudo’.

Manual Pages

For security reasons, it is important that your computer is regularly kept up to date with the latest updates. Now, we could do this through the Graphical User Interface (GUI) that can be accessed through ‘Ubuntu Software’, navigating across to the ‘Updates’ tab and installing all available updates. However, that is boring and slow.
Instead, let’s use the command ‘sudo apt-get update && sudo apt-get upgrade’. The ‘&&’ operator combines the two commands together and runs them one after the other. After running the command, the terminal will prompt for a password, and then require either a Y/N to confirm or deny the updates.

Update Command

Updates have now been completed. Now, I need to see which folders are in the Home Directory. To do this, we need to type ‘dir’, followed by pressing the Enter key on the keyboard.

dir command

Folder and files are case sensitive in Linux, so if we are searching for something specific, we need to ensure it is spelt exactly the same or it will ignore it.
I want to create a file in the ‘Documents’ folder. This can be done by typing ‘CD Documents’.

CD Documents

Using the ‘CD Documents’ command has opened that directory, however, I’m not sure if the file that I’m looking for is saved here or not. To find this out, I’m going to need to list everything that is in the Documents folder. Type the command ‘ls’. Short for ‘list’, this will show whether the file I’m looking for is there or not.

ls command

I was looking for the Python file labelled ‘file.py’, it was saved in this folder after all.
Now that the file has been found, I can continue working on it. By using the command ‘vim file.py’, I can work on the file in the terminal.

Vim file.py

To work on the file, press ‘I’ to put Vim into ‘insert’ mode, allowing changes to be made to the file. After making the changes to the document that needed to be made. Its time to save and exit. To exit Vim type, :wq!
This will save and quit Vim taking us back to the terminal window. Now that we have finished working in the terminal, type ‘exit’ to quit.

Working in Vim

Published by Daniel Wray

IT Support Engineer; Studying for CompTIA Network+. 100 Days of Python Challenge. Aspiring blogger. Passion for Learning and Teaching! https://ko-fi.com/danielwray4

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: