# Why Developers Should Understand the Terminal and Linux

Recently, I've been spending some time learning more about the terminal, shell and how operating systems work. Not necessarily because I want to become a system administrator, but because I've realised that there are things I use regularly as a developer that I don't really understand.

For example, I've used commands like `npm install`, `git`, `mkdir`, `cd` and several others for a while. I know what they do, or at least what they are supposed to do. But I've never really spent much time understanding what happens when I execute these commands.

The same applies to tools like Homebrew, Docker and even PostgreSQL.

I recently tried installing PostgreSQL on my Mac using Homebrew. During the installation, one of its dependencies failed to compile. Fixing that issue took me through C headers, libraries, compiler errors and Homebrew formulae. I eventually had to understand what was happening with one of the libraries before I could get the installation working.

Then I needed pgvector for PostgreSQL. I discovered that installing PostgreSQL wasn't the same as installing its extensions. There were files that needed to be compiled and installed in specific directories, and the PostgreSQL installation needed to know where to find them.

I also ran into a permissions issue because the database user I created didn't have the privileges required to install an extension.

These might seem like ordinary installation problems, but they made me realise something: I've been using a lot of developer tools without understanding enough about the systems they depend on.

## Understanding the terminal

I think one of the reasons I didn't pay much attention to this earlier is that most of the tools we use have made things very convenient.

You can install packages with a single command, start a development server, connect to a database and perform several other operations without necessarily understanding what happens underneath.

There's nothing wrong with that. These tools exist to make our work easier.

However, when something goes wrong, knowing only which command to execute isn't always enough.

I want to understand what happens when I run a command. How does the shell interpret it? How does the system locate the program? What determines whether a process can access a particular file? Where are installed applications and their dependencies stored?

These are some of the questions I've started paying attention to.

I also think it's important to understand the difference between the terminal, shell and operating system.

The terminal is the interface through which we interact with the shell. The shell interprets the commands we enter, while the operating system handles the underlying processes and resources.

Linux, on the other hand, is an operating system kernel. It is a major part of many operating systems used to run servers and other computing environments.

Understanding these distinctions is a good starting point.

## Why Linux?

Most developers will eventually interact with Linux systems in one way or another, especially when working with servers, cloud infrastructure and deployment environments.

Even if you primarily work on macOS or Windows, having some knowledge of Linux is useful.

For instance, when deploying an application to a Linux server, you may need to manage processes, configure environment variables, inspect logs, set file permissions, install system packages or troubleshoot networking issues.

You could learn the commands needed to do these things, but understanding the concepts behind them makes a difference.

It also helps when working with Docker. Containers aren't just another way to package applications. They rely on operating system features, and understanding processes, filesystems and networking makes Docker much easier to reason about.

## What I'm interested in learning

I don't intend to learn everything at once. I want to understand the fundamentals and gradually build on them.

Some of the things I'm currently interested in include:

- How operating systems organise files and directories.
- How shells work and how commands are executed.
- Processes, threads and background services.
- File ownership, permissions and user privileges.
- How package managers install and manage software.
- Environment variables and shell configuration.
- Compilers, libraries, headers and linking.
- Networking, ports and how applications communicate.
- How Linux manages system resources.

I also want to understand some of these things from a lower level. For example, how programs interact with the operating system, how memory is managed and how software eventually gets executed by the processor.

I know this goes beyond what I need to build most applications, but I find it interesting, and I think it will give me a better understanding of the tools I work with.

## Final thoughts

I don't think every developer needs to become an expert in Linux or spend all their time working in the terminal.

But I do think understanding the command line, the shell and some operating system fundamentals should be part of becoming a better software developer.

There is a difference between knowing how to use a tool and understanding how it works. I don't think we need to understand every implementation detail of every tool we use, but we should be willing to look beyond the interface when we have the opportunity.

That's something I'm trying to do more deliberately now.
