How To Linux : From Simple Commands To DevOps

Introduction to Linux for a developer and its DevOps uses

Meriem Bouyahiaoui
introductionmarkdownlinuxdevops

How To Linux: From Simple Commands To DevOps

1. Introduction

Linux is at the core of modern development and DevOps. For developers, learning it means gaining control over your tools, environments, and deployments. Even a basic understanding can make everyday tasks like building, testing, and deploying software faster and easier.

But why does Linux matter so much, and how can you actually put it to use? In this article, we’ll break down the fundamentals and walk through simple commands that are not just useful for a developer’s everyday, but also power real-world DevOps workflows so you can start building with Linux right away.

2. Getting Started with Linux

Linux is a free, open-source, Unix-like operating system developed by Linus Torvalds that runs on a wide range of devices, from servers and smartphones to supercomputers. As an operating system, it manages a computer’s hardware and software, providing a platform for users to run applications.

💡 Open Source ?
Open source means the source code is freely available to use, modify, and share. It comes with many advantages, so don’t hesitate to explore it further!

Understanding the Linux Filesystem Hierarchy

In Linux, a “file” is a fundamental unit of storage that contains data or information. There’s a popular quote about this: “On a UNIX system, everything is a file.”

This philosophy allows developers to read, write, and modify data from devices and processes using the same tools they use for regular files. In other words, you can customize everything you do for a simple file for literally anything in your system—even your hardware.

Linux generally follows a Filesystem Hierarchy Standard (FHS). This standard reference describes the common layout conventions used by most UNIX and UNIX variant systems. It consists of a single root directory with multiple branching sub-directories. It’s a tree hierarchy.

Linux File System Figure 1: Linux Tree Hierarchy

The most important directories that every developer should know about are:

  • Root Directory /: The root directory is the starting point for the entire Linux filesystem hierarchy. It is owned by the root user (admin) and its permissions are tightly controlled.

  • Home Directory /home: This directory contains the personal directories for all regular users on the system. For example, a user named username will have /home/username.

  • /etc: This directory contains system-wide configuration files. As a developer, you may need to modify files here to configure system services, network settings, or app-specific configurations.

  • /tmp: Temporary storage area for files created by apps and users. It is meant for temporary files and is automatically cleaned on reboot, so don’t store important data here, but you can use it for temporary build artifacts, intermediate files during compilation, or for testing purposes.

  • /var: Holds variable data files, such as logs and temporary files. You can check log files in /var/log for debugging applications or monitor data in other subdirectories of /var.

  • /usr/bin: Contains most executable programs and commands that users interact with daily (e.g., gcc, python, git).

💡 Special Tip
~/.local is a hidden directory within a user’s home directory in Linux. It is the perfect place to store user-specific data, configurations, and applications not meant for system-wide use.

Choosing a Linux Distro for Development

Now that we understand the Linux filesystem, let’s move on to Linux distributions. Commonly called distros, these are complete operating systems built around the Linux kernel, plus a collection of software and utilities.

💡 Kernel ?
The central core of an operating system. It acts as a bridge between your computer’s hardware and the software you use, managing CPU, memory, and devices.

Each distribution packages the necessary tools for what it’s made for, and here are some popular distros for developers and DevOps:

  • Ubuntu: For beginners, Ubuntu is one of the best choices. In addition to its user-friendliness, it is backed by a vast community, making it easier to find solutions to most problems. With its Long Term Support (LTS) versions, developers can rely on a consistent and well-maintained environment.

    • Why: Stable, user-friendly, strong community support
    • Best for: Full-stack development, Python, PHP, Node.js
    • Features: Works seamlessly with Docker, VS Code, and other dev tools
  • Fedora: Fedora is a community-driven Linux distribution sponsored by Red Hat (an enterprise-focused Linux distro). Use Fedora if you want the newest packages and the latest software advancements. It is a popular choice among developers and often serves as a testing ground for new technologies.

    • Why: Newest technology, Red Hat–backed, stable
    • Best for: Developers needing latest software versions
    • Features: Good GNOME desktop experience, strong default security
  • Debian: Debian serves as the backbone for many other Linux distributions, including Ubuntu. It emphasizes reliability and security, making it a trusted option for server-focused development. With its large package repository and thorough testing process, developers can depend on software that is stable and well-maintained.

    • Why: stable, strong community support
    • Best for: Server or desktop developers needing reliability
    • Features: Extensive documentation, Highly suitable for both server and desktop environments

3. Essential Linux Commands for Developers

When working on Linux, the terminal is one of your most powerful tools. Commands usually follow this general format: command -options parameters.

  • Command → the action you want to perform
  • Options (flags) → extra settings that change how the commands behave
  • Parameters → the target (file, directory, or URL)

In this article, we will only include necessary ones, but if you’re curious about other commands and their options I encourage you to read about them, you can also use man <command> or <command> --help.

3.1 Getting Around the System

Before working with files or installing tools, you need to know how to move around in Linux.

  • pwd → show current working directory
  • ls → list files and directories (ls -l for details, ls -a to include hidden files)
  • cd <directory> → change directory

💡 Hidden Files ?
Special files that start with . (e.g., .env).

Keyboard shortcuts:

  • Tab → autocomplete
  • → previous command in history
  • Ctrl+L or clear → clear screen

3.2 Managing Files and Directories

As you know now, linux is all about working with files, and knowing how to manage them is the ultimate secret to work smoothly in this system.

  • touch <file> → create empty file
  • mkdir <dir> → create a directory
  • cp <source> <dest> → copy files
  • mv <source> <dest> → move or rename files
  • rm <file> → delete files (rm -r <dir> for directories)

Viewing and editing:

  • cat <file> → print file content
  • less <file> → view page by page
  • head <file> / tail <file> → view start/end of file
  • vi <file> → pre-installed editor
  • nano <file> → beginner-friendly editor
  • vim <file> → advanced editor

3.3 Searching and Filtering

  • grep "word" <file> → search for word inside the file
  • find <path> -name <file> → search for files/directories by name
  • locate <name> → quickly find files (it uses a prebuilt database, so run updatedb first)

3.4 System Monitoring and Processes

Developers often need to check what’s running on their system.

  • top → view running processes
  • df -h → check disk space
  • free -h → check memory
  • systemctl status <service> → check the status of a service
  • kill -9 <pid> → terminate a process

3.5 Networking Basics

Linux is widely used for servers, so networking commands are essential.

  • ping <address> → test connectivity
  • curl <url> → fetch data from a URL
  • wget <url> → download files
  • ssh <user>@<host> → connect to remote server

3.6 Users & Permissions

Linux is a multi-user system, so some actions require administrator rights.

  • sudo <command> → run a command with administrator (root) privileges. You’ll often need this when installing software or changing system settings.

3.7 Package Managers and Software Installation

Installing software on Linux is done through package managers. They handle installation, updates, and dependencies automatically. Different distros use different managers:

  • apt → Debian/Ubuntu based systems
  • dnf → Fedora based systems
  • yum → Red Hat based systems (nowadays mostly replaced by dnf)

Common package manager commands (using apt):

  • apt update → update package lists
  • apt upgrade → upgrade software
  • apt install <package> → install new software
  • apt remove <package> → uninstall software
  • apt search <package> → search for packages

4. Linux in DevOps Workflows

By now, we’ve seen why Linux is valuable for developers and how can they use it. But its true strength shines in DevOps workflows, where nearly every modern tool and platform relies on it in some way:

  • Cloud infrastructure: Most cloud servers (AWS, GCP, Azure) run on Linux distributions like Ubuntu, CentOS, or Amazon Linux.
  • Containers: Docker and Kubernetes rely on Linux kernel features (namespaces, cgroups) to isolate and manage containers.
  • Automation: CI/CD tools (Jenkins, GitLab CI, GitHub Actions) often run build and deployment steps as shell or Bash scripts.
  • Configuration Management: Tools like Ansible, Puppet, and Chef use Linux commands and services to provision systems, apply configurations, and automate tasks.
  • Monitoring & Logging: Tools such as Prometheus, ELK stack, and system monitoring often integrate tightly with Linux processes and logs.
  • Secure remote access: With SSH, Linux provides secure server access, file transfers, and remote management for distributed systems. For a DevOps engineer, knowing Linux lets you work confidently across almost any DevOps workflow.

5. Conclusion

Throughout this article, we explored what Linux is, how its file-based nature makes many operations rely on consistent commands, the essential commands themselves, and finally, why Linux is such a cornerstone in the DevOps world.

It’s also worth noting that beyond DevOps, Linux plays an important role in almost every career path within computer science, which makes it a powerful skill to learn and hone.

What I’ve shared here is just a small glimpse into the vast world of Linux and its contributions to DevOps. The best way to truly master it is to keep exploring on your own: experiment, practice, and stay curious. Linux is a deep field, and every step you take will unlock new questions and possibilities.

Resources