Lesson 1 of 5 · Linux for DBAs

Linux Basics for DBAs

What Linux is, why DBAs need it, how it's built from the kernel up, how its filesystem is organized, and how to connect to a Linux server.

Beginner 9 sections 6 min read

What's Linux

Linux is a free, open-source, Unix-like operating system (OS). Linus Torvalds released the first version of its kernel in 1991.

  • Open source: the source code is freely available, and anyone may study, modify, and redistribute it.
  • Unix-like: Linux behaves and feels like the Unix operating system. It shares Unix's core design ideas and its command-line interface.
  • Distributions: a Linux distribution (also called a distro or flavor) packages the Linux kernel with tools, a package manager, and other software into a complete operating system. Popular distros include Red Hat Enterprise Linux (RHEL), Oracle Linux, Ubuntu, Debian, SUSE Linux Enterprise, Fedora, and Kali Linux.

Why DBAs need Linux

Most production databases run on Linux. Oracle Database, MySQL, and PostgreSQL are built and tested on Linux first. Microsoft SQL Server is the main exception: it started on Windows, though it has also run on Linux since SQL Server 2017.

  • Linux gives DBAs more control over system resources such as memory, storage, and processes.
  • It delivers strong, stable performance for database workloads.
  • Modern automation tools, such as Ansible, Terraform, and shell scripts, run naturally on Linux.
  • It can cost less: many distributions are free, and enterprise distributions sell support subscriptions instead of per-server licenses.

How Linux is built

Linux is built in layers, and each layer has a clear job. Together they keep the system running smoothly.

Operating system Shell Apps Utilities Kernel Hardware (CPU, RAM, storage)
Programs never talk to the hardware directly; everything goes through the kernel.
Kernel
Manages the hardware and shares it between programs.
Shell
The command-line interface (CLI) you type commands into.
Apps and utilities
The software you install and the tools that come with the OS.

The kernel

The kernel is the core of the Linux operating system. It:

  • Communicates directly with the computer's hardware.
  • Acts as the middleman between hardware and software.
  • Handles complex tasks, such as memory and process management, so applications don't have to.

The shell

The shell is a command-line interface that lets you communicate with Linux. Think of it as the translator between you and the system.

What happens when you type a command

  1. YouType a command
  2. ShellPasses it to the kernel
  3. KernelDoes the work
  4. ShellShows you the result

Types of shells

There's more than one shell, and each has its strengths. Bash is the one you'll use most.

Unix shells sh Bourne bash Bourne Again zsh Z shell ksh Korn tcsh TENEX C csh C shell
ShellWhat to know
Bourne shell (sh)Written by Stephen Bourne at Bell Labs and released in 1979. It became the standard Unix shell and the foundation for many modern shells.
Bash (Bourne Again Shell)Released in 1989. The most widely used shell and the default on most Linux distributions.
C shell (csh)Written by Bill Joy in the late 1970s. It introduced interactive features such as command history.
tcshAn enhanced C shell that adds command-line editing and completion.
KornShell (ksh)Written by David Korn at Bell Labs and released in 1983. It combines Bourne shell compatibility with C shell features and strong scripting. Common on AIX and older Unix systems.
Z shell (zsh)Released in 1990. Highly customizable, and the default shell on macOS since 2019.

To see which shell you're using, run:

$ echo $SHELL
/bin/bash

CLI vs GUI

$ ls -lt total 12 -rw-r--r-- 1 kofi 728 Oct 2 report.csv drwxr-xr-x 2 kofi 4096 Oct 1 backups -rw-r--r-- 1 kofi 4372 Sep 30 notes.txt $ █ CLI: type commands Home Documents Downloads backups report.csv notes.txt GUI: point and click
CLI (command-line interface)GUI (graphical user interface)
How you workType commandsPoint and click
StrengthsFast, scriptable, and works over remote connectionsEasy to discover and learn
Where you'll see itLinux serversDesktops and Windows servers

Most Linux database servers have no GUI installed at all, so DBAs work almost entirely in the CLI.

The Linux filesystem

The Filesystem Hierarchy Standard (FHS) is a set of guidelines, maintained by the Linux Foundation, that defines the directory structure of Linux and other Unix-like systems. It keeps directories consistent across distributions. Everything starts at the root directory, written as a single slash: /.

/ bin etc home lib usr var kofi jdoe bin include Project Results Documents ls who
The highlighted path is /home/kofi/Project.

Key directories

PathWhat it holds
/The root: the top of the entire directory tree.
/bin, /usr/binCommand programs (binaries), such as ls. On most modern distributions, /bin is just a link to /usr/bin.
/etcSystem configuration files.
/homeUsers' home directories, such as /home/kofi.
/varData that changes while the system runs, such as logs in /var/log.
/usrInstalled programs, libraries, and documentation.
/optOptional add-on software. Some database software is installed here.
/devDevice files that represent hardware, such as disks and USB drives.
/lib, /usr/libShared libraries that programs need to run.
/tmpTemporary files, often cleared when the system restarts.

Windows paths vs Linux paths

Windows uses its own directory structure, defined by Microsoft. The same folder is written differently on each system:

WINDOWS LINUX C:\ Program Files Windows Users kofi jdoe Project / bin etc home kofi jdoe Project C:\Users\kofi\Project /home/kofi/Project

Windows and Linux terms

WindowsLinux
Owned by Microsoft (closed source)Open source
FolderDirectory
Administrator is the superuserroot is the superuser
Drive letters, such as C: and D:Mount points: disks are attached somewhere in the one tree, such as /home
GUI firstCLI first
PowerShell and Command PromptShells such as bash
Windows directory structureFHS (Filesystem Hierarchy Standard)
File names aren't case-sensitiveFile names are case-sensitive: Report.txt and report.txt are different files
Backslash in paths: C:\Users\kofiForward slash in paths: /home/kofi

Connecting to servers remotely

You'll rarely sit in front of a database server. Instead, you connect to it over the network.

Your computer SSH · PORT 22 RDP · PORT 3389 $ ssh kofi@dbserver kofi@dbserver:~$ █ Linux server: command line Windows server: full desktop
SSH (Secure Shell)
Opens an encrypted command-line session on a remote Linux server. It uses port 22.
RDP (Remote Desktop Protocol)
Opens the full graphical desktop of a remote Windows machine. It uses port 3389.

To connect over SSH, give your username and the server's name or IP address:

$ ssh username@server-address
$ ssh kofi@10.1.149.123     # example

Key takeaways

  • Linux is a free, open-source, Unix-like OS, and most production databases run on it.
  • It's built in layers: hardware, the kernel, and the shell and programs on top.
  • Bash is the shell you'll use most.
  • Everything lives in one directory tree starting at /, organized by the FHS.
  • Linux is case-sensitive and uses forward slashes in paths.
  • Connect to Linux servers with SSH (port 22) and to Windows servers with RDP (port 3389).