The Terminal: Understanding the Why Behind Basic Linux Commands

Introduction

When I first started learning Linux, I didn’t just want shortcuts. I wanted to understand what I was doing—why things worked the way they did. That’s what this blog is all about. Not just giving you a list of basic commands, but helping you grasp the why behind each one. Why you need them. What problems they solve. How to think like the terminal.

This isn’t just another tutorial. It’s a mindset shift.

The Real Problems Beginners Face

When you’re new to Linux, it’s easy to get stuck. These are real problems I’ve faced, and many others do too:

  • You try to install software, but it fails. Often because your system is not updated or you’re not using sudo.

  • You download software, but can’t run it. Why? No execute permission—chmod is the missing piece.

  • You get lost in folders using cd ../folder/folder/... and don’t know where you are.

  • You waste time manually creating files and folders one-by-one, not knowing you can do it all at once with commands like mkdir and touch.

  • You scroll endlessly trying to find a file in the GUI instead of using find to locate it instantly.

These are basic problems—but they hold people back. Let’s fix that, not just by showing commands, but by understanding them.

What Is a Command?

A command is the native language of the operating system. It’s a set of instructions you give to the computer through the terminal. The shell interprets it, translates it, and the kernel carries out the task.

But every command has structure. Think of it like grammar. Here's how it works:

🔸 Components of a Command:

  • The command itself — e.g., ls, cd, chmod

  • Flags (or options) — modify the behavior of the command. Example: ls -l shows file details.

  • Arguments — values passed to the command. Example: find . -name filename.txt, where ., -name, and filename.txt are arguments.

And the reason we have flags and arguments? To make commands flexible. That’s how we go beyond just the basics.

The terminal provides a manual that provides additional information on commands. Use man [ name of command ] to understand what that command is about, how to use it and the additional flags you can use

Why sudo apt update Matters

Before installing anything on a Linux machine, especially Ubuntu or Debian-based systems, you must update your system.

But why?

A package is like a container with everything the software needs—binaries, metadata, config files. But it often relies on dependencies—other packages it needs to function.

Keeping separate shared dependencies reduces disk space. When a shared file gets updated, you only need to update that one, not every copy in every package.

A repository is the storage house where all these packages live. And apt is the package manager for Ubuntu and Debian systems that helps you manage them.

Package managers help to download the latest version of your software application and resolve any conflicts and dependencies. It also takes care of any bug related issues and ensures you are are not running outdated libraries and packages.

So, when you run:

sudo apt update // use this 
sudo apt-get update // or this. 
// They both do the same thing

You’re doing three things:

  • Using sudo to grant superuser rights

  • Asking apt to refresh your package list

  • Ensuring all packages are up to date with the latest bug fixes and libraries

That’s why you should update before installing. It saves you from broken packages and dependency errors.

Understanding File Permissions with ls -l and chmod

Here’s where people often get stuck. They try to run a program and nothing happens. Why?

Because the file isn’t executable.

Use:

ls -l

This lists files in long format and shows file permissions.

A sample output:

-rwxr-xr-- 1 user group 1048 Jul 20 2025 my_script.sh
drwxr-xr-x  3 user group 4096 Jul 20 2025  index.js

Let’s break it down:

  • File permissions are generally represented in a symbolic format. i.e, [ File type | Permission settings(rwx) | User owner | Group owner ]

  • Read permission (r) is used to access the file's contents.

  • Write permission (w) allows you to modify or change the contents of a file.

  • Execute permission(x) allows you to execute the contents of a file.

  • There are nine permissions for 3 different groups, owner, group and others respectively. e.g rwxr-xr- -

    • - symbol represents that the permission for that particular action is not granted
  • First symbol in the beginning of the long list format:

    • -: It's a regular file.

    • d: It’s a directory

  • rwx: Owner (user) has read, write, execute

  • r-x: Group has read and execute

  • r--: Others have read only

This format helps you answer:

  • Who can read, write, or execute this file?

  • Is this a directory or a file?

  • Should this file be executable?

To make a script executable:

chmod u+x filename.sh // grant user executable permission 
chmod +x filname.sh // grant permission to all groups
chmod u+x,g+x filename.sh // grant permission to user and group owner only

Want full control? You can set permissions directly using numeric values:

chmod 755 filename.sh

Where:

  • 7 (owner) = read + write + execute (111)

  • 5 (group) = read + execute (101)

  • 5 (others) = read + execute (101)

  • The numbers are represented as binary and when you convert them to decimal you get 755.

Understanding this lets you control who can do what with your files. Without this knowledge, you’re always guessing.

You can also add read and write permissions.

Use the - symbol to remove permissions. e.g

chmod u-x filename.sh // remove execute permissions for user
chmod u-r filenma.sh // remove read permissions for user

Navigating with cd and pwd

Getting lost in the terminal is common. I used to chain commands like:

cd ../../somefolder/docs

…and then forget where I was.

Use:

pwd

To print your working directory—where you are.

Combine that with smart cd usage, and you always stay oriented.

This teaches you to visualize the file system in your mind, like a tree. It sharpens your thinking and spatial awareness inside the system.

cd command is used to change the directory of where you are to which directory you want to navigate to

cd .. //shortcut for navigating to the previous directory
cd . // current directory

. represents current directory


Speeding Up with mkdir, touch, and find

Creating files and folders one by one? Too slow.

Use:

mkdir folder1 folder2 folder3

To create multiple folders in one shot.

Or:

touch file1.txt file2.txt

To create multiple files instantly.

And when you can’t find a file:

find . -name "filename.txt"
find ../documents/books -name "Linux.pdf"

The . represents current directory. You can replace the . with any file path

Stop wasting time scrolling. Let the system do the search for you.

Final Thoughts

We often underestimate the terminal because it looks intimidating. But behind its plain black screen is raw power.

Every command you master is a key to unlocking that power.

Learn the why behind the commands. Master the logic. Train your thinking. That’s how you go from just using Linux—to commanding it.

You’re not just typing commands. You’re communicating with your machine. And the more fluent you become, the more control you have over your own digital universe.

0
Subscribe to my newsletter

Read articles from Ray Mcmillan Gumbo directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Ray Mcmillan Gumbo
Ray Mcmillan Gumbo

A deep thinker, builder, and learner sharing my journey through tech and thought. This blog is my space to reflect, explore hard questions, and document growth — not just in skills, but in purpose. It’s for anyone who feels lost, curious, or stuck — a reminder that your voice, ideas, and path still matter. Here, I write before ideas become products and code becomes real — the foundation behind Ryom and the questions that drive it.