Linux Command Line and Packages

Navigate the filesystem, read documentation, install software and get comfortable working on a remote Linux server.

Beginner · about 15 hours · difficulty 1/5

The Linux command line is your primary workspace as a DevOps engineer. Servers usually have no GUI, containers are Linux userlands, and CI jobs run shell commands. Fluency here makes everything else faster.

Essentials

  • Navigation and files: pwd, ls -la, cd, cp, mv, rm, mkdir -p, find, tree.
  • Reading files: cat, less, head, tail -f, wc.
  • Getting help: man, --help, and tldr for quick examples.
  • Pipes and redirection: |, >, >>, 2>&1, and tee.
  • Environment: PATH, export, env, and dotfiles like ~/.bashrc.

Distributions and package managers

Distros differ mainly in package tooling and release cadence. Debian and Ubuntu use apt with .deb packages; RHEL, Fedora, Rocky and Amazon Linux use dnf/yum with .rpm; Alpine (popular in containers) uses apk. Learn to search, install, pin versions, add a vendor repository with its signing key, and apply security updates.

Pitfalls

Running everything as root, piping random curl | sh installers without reading them, and not knowing which distro you are on (cat /etc/os-release).

Good enough to move on: you can SSH into a fresh VM, find what distro it runs, install and update packages, locate a config file with find, and follow a log with tail -f.

Key concepts

  • Filesystem navigation
  • Pipes and redirection
  • man pages and help
  • Environment variables and PATH
  • apt (Debian/Ubuntu)
  • dnf / yum (RHEL family)
  • apk (Alpine): Common in container images
  • Snap / Flatpak

Mini project

Spin up an Ubuntu VM (or WSL), install nginx from apt, find its config and log files with find, and write down every command you used as a reproducible setup script.

Check yourself

What is the difference between > and >> and what does 2>&1 do at the end of a command?

Free resources