Skip to main content

Command Palette

Search for a command to run...

Linux Fundamentals for DevOps: User Management, File Operations & Navigation

Updated
3 min read

Introduction

Linux is the foundation of most modern DevOps workflows. From managing cloud servers to automating deployments, a DevOps engineer interacts with Linux daily — often without a graphical interface. Mastering these fundamentals isn’t just a beginner step; it’s an investment in speed, accuracy, and confidence when working in production environments.

Today, I focused on user management, file and directory operations, vi text editing, and navigation. These are the building blocks for tasks like server provisioning, CI/CD configuration, and troubleshooting.


1. User Management

Linux primarily has two user types:

  • ec2-user – Default user for Amazon EC2 instances, with limited privileges.
    Example: ec2-user@ip-172-31-45-20:~$ whoami → ec2-user

  • root – Superuser with complete administrative control over the system.
    Example: root@ip-172-31-45-20:~# whoami → root

Why It Matters in DevOps:
Switching between limited and superuser access is part of daily operations — for example, installing packages, managing services, or configuring system-level settings.

Switching Users:

  • sudo su – Switch to root.

  • sudo -i – Start a root login shell.

  • exit – Return to the previous user.

Example Scenario: Installing Apache requires root privileges: sudo yum install httpd -y


2. File and Directory Operations

Why It Matters in DevOps:
Almost every DevOps task involves files — whether it’s managing configuration files, deployment artifacts, or logs. Efficient file and directory handling saves time and reduces errors.

Creating Files:

  • touch notes.txt – Creates an empty file.

  • cat > todo.txt – Creates a file and writes content (overwrites existing content).

  • cat >> todo.txt – Appends content without overwriting.

Batch File Creation: touch file{1..5}.txt – Creates multiple files at once.

Checking File or Directory Type:

  • ls -l – A leading “d” indicates a directory; “-” indicates a file.
    Example: drwxr-xr-x → Directory, -rw-r--r-- → File

Creating Directories: mkdir projects – Creates a new directory named “projects”.


3. Editing Files with vi

Why It Matters in DevOps:
In remote servers or minimal environments, vi is often the only editor available. Being fluent in it is essential for quickly editing configuration files.

Basic Workflow:

  1. vi report.txt – Open or create a file.

  2. Press i – Enter insert mode.

  3. Type content (e.g., “Daily Standup Notes”).

  4. Press Esc → :wq – Save and quit.

  5. :q! – Quit without saving.


4. Navigation

Why It Matters in DevOps:
Quick and accurate navigation helps when working across multiple services, logs, or project directories during deployments and incident responses.

  • pwd – Displays the current working directory (e.g., /home/ec2-user/projects).

  • cd .. – Move up one level.

  • cd – Return to the home directory.

  • clear or Ctrl + L – Clear the terminal for a clean workspace.

  • cd - – Toggle between the last two directories (useful during troubleshooting).


Reflection

Today’s work was not about learning commands once — it was about building operational fluency. I intentionally repeated tasks in different contexts, like editing multiple files, switching between users, and creating directory structures as if setting up a new project environment.

This hands-on approach is already making me faster in the terminal, which is crucial for a DevOps engineer who often works under time pressure during deployments or incident resolution.


Next Steps

For tomorrow’s learning, I’ll focus on:

  • File permissions and ownership (chmod, chown)

  • Process management (ps, top, kill)

  • Basic shell scripting for automation

More from this blog

Documenting My DevOps Journey

40 posts